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: -fnon-call-exceptions + -fprofile-arcs on x86



On May 10, 2004, at 07:54, Eric Botcazou wrote:


Hi,

We ran into a problem with -fnon-call-exceptions + -fprofile-arcs on x86.
Now -fnon-call-exception is the default for Ada, so the problem is already
present with -fprofile-arcs for the Ada compiler (and further exacerbated by
-fstack-check).


-fprofile-arcs needs to add increment insns on some edges of the CFG. The
'add' insns on x86 clobber the condition code register so -fprofile-arcs
wreaks havoc when the condition code register is live on the edges it adds
insns on.


It's possible (and very easy with -fstack-check) to have the condition code
register live on edges with -fnon-call-exceptions: a compare-and-jump
construct whose operands are trapping MEMs is sufficient. This leads to
wrong code because the compare is eventually deleted.


Now to the question: is this fixable in profile.c? If no, would a patch that
prevents the middle-end from generating compare-and-jump constructs that
span two basic blocks be acceptable?


I thought this was fixed when PR 11767 was fixed.

Thanks,
Andrew Pinski


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