The ebuild file for postgresql specifies "--with-openssl=/usr" during the configure stage. Unfortunately, this leads to "-I/usr/include" being added to CFLAGS by the autoconf script, which in turn causes gcc3 to issue the dreaded "seach path has been re-ordered" warning -- and that causes the configure script not to find _any_ header file. Just remove the "/usr" parameter in the ebuild file and postgres should build fine with gcc3 (and openssl).
Ah ha! I was just gawking at the same error :) Thanks for the report.
this is fixed in 7.2.1-r* i believe