[PATCH] Fix middle-end/32813 ICE in annotate_all_with_locus

Andrew Pinski pinskia@gmail.com
Sat Aug 4 11:41:00 GMT 2007


Hi,
  The fortran front-end calls annotate_all_with_locus with a statement
list which included coumpound statement which was generated by fold
and annotate_all_with_locus does not like the compound expression at
all.  The compound expression was generated when fold was folding
COND_EXPR<SAVE_EXPR, EMPTY_STMT, EMPTY_STMT> and decided it needed to
keep around the SAVE_EXPR (which is correct).  Since we really don't
need to generate a compound expression here, I changed
omit_one_operand and pedantic_omit_one_operand for this case to just
return a cast to void type of the ommited expression.

I also had to fix up gfortran.fortran-torture/compile to run through
all the options instead of just -O.

OK?  Bootstrapped and tested on i686-apple-darwin8.10 with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

* fold-const.c (omit_one_operand): Return only the ommitted expression
if the result is an empty statement.
(pedantic_omit_one_operand): Likewise.


* gfortran.fortran-torture/compile/emptyif-1.f90: New test.
* lib/fortran-torture.exp (fortran-torture): Use TORTURE_OPTIONS instead
of just -O.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpr32813.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070804/6cb99a7f/attachment.txt>


More information about the Gcc-patches mailing list