Arduino Mega pinout 3 problem

Hello,
I've found problem with compilator. I want to use pin 3 witch is teoreticaly at PORTE 5 as output (LED). Also I want to use whole PORT 3 as input. I have found out that when I write:
pinMode(3, OUTPUT);
pinMode(PORTC5, INPUT_PULLUP);
the LED output doesn't work.

I've made some experinces and I've found out that pin 3 is at PORTC 3 not at PORTE 5. Electrical it's connected to PORTE 5 but arduino compilator makes it to wrok as a PORTC 3.

Is it compilator bug or what?

What do you have PORTC5 defined as?

On diagram pin3 is at port PE5, but the compilator contol this pin 3 by port PC3.

I think your getting confused (or I am)…
arduino pin 3 is PORTE bit 5 (PE5).
Your sample code is doing pinMode(PORTC5, INPUT_PULLUP); and PORTC5 is defined as being 5 in the AVR header files so it is equivalent to doing pinMode(5, INPUT_PULLUP);.
The probable reason your saying PORTC3 works is because it is defined as 3. Try reading this and google to find out more about direct port manipulation.