This is the mail archive of the gcc@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: Does anybody really know which pass it is?


> Joining the recent debate about documentation quality, I am currently
> trying to figure out which optimization pass fries one piece of code of
> mine.  This happens on HPPA since GCC 3.0 till at least GCC 3.2.3.  The
> code runs properly with -O0 and fails with -O1.  It also behaves well on
> all other platforms.  I know that "on most machines, the -O option turns
> on the -fthread-jumps and -fdelayed-branch options, but specific machines
> may handle it differently."  After some (not-so-)educated guesses I
> have tried passing all sorts of -fno-do-this I could find in the
> documentation in order to find the culprit but to no avail.  I must
> be still missing an optimization pass...

If the compiler ICE's, it is quite easy to determine the pass.  This
can be done with the "-da" option, or by running the compiler under gdb
and doing a backtrace from the point of the ICE.  The line number
in toplev.c will by inspection allow determination of the pass.

If your code is silently miscompiled, then it's much more difficult
to determine which pass fries your code.  Unless you have a significant
amount of experience in debugging the compiler, it's probably better
to focus on generating a simplified testcase which demonstrates the
problem and then file a PR.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

PS: try 3.3.


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