This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to use ld -z on IA64 HP-UX


Joseph S. Myers wrote:
This patch adds -z (fault on NULL pointer dereference) to the linker
options GCC uses on IA64 HP-UX.  It is already used on PA HP-UX and
there isn't a known reason to be inconsistent in this regard between
HP-UX on different architectures; faulting on NULL pointer dereference
is also the norm on other platforms and can cause certain GCC bugs to
yield an ICE quickly rather than making the compiler hang.

This change is OK, in principle, but I'm a little confused by:


This patch also changes ia64_function_value to avoid giving
(parallel:BLK []) as the location where an empty structure is
returned, because otherwise the IA64 HP-UX compiler gets a NULL
pointer dereference compiling gcc.c-torture/compile/920928-5.c (among
other tests involving empty structures).  (I see nothing in principle
wrong with an empty PARALLEL here, but NULL pointers are used in place
of empty vectors and this only works when NULL can be dereferenced.)

this. Your patch seems OK, but why doesn't the original formulation work? Are you saying that there code elsewhere in GCC that then tries to dererference a NULL pointer? If so is that code buggy, or is it a fact that PARALLELs must have at least one element? (That constraint doesn't seem to be documented; if it is true, then it should be documented.)


I think that you should also explain a comment saying that an empty PARALLEL is not allowed, but that the return value doesn't matter.

OK with that change, so long as the answers to the above questions are that "yes, empty PARALLELs are invalid".

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]