[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-06 Thread rguenth at gcc dot gnu dot org


--- Comment #5 from rguenth at gcc dot gnu dot org  2009-04-06 11:14 ---
For cris-axis-elf we do not fold

  one_1 = 1.0e+0;
  oneL_2 = 1.0e+0;
  __builtin_sincos (1.0e+0, s, c);

to a constant because __builtin_sincos did not get transformed to
__builtin_cexpi.

We fold it later via the fold-all-builtins pass but nothing promotes
memory to registers after that pass with -O1.  I have a patch that should
fix this.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Keywords||missed-optimization
   Last reconfirmed|2009-04-05 22:00:23 |2009-04-06 11:14:36
   date||
   Target Milestone|--- |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-06 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-04-06 11:00 ---
Ok, I can see at least one missed CCP optimization when looking at what
the x86_64 target produces.  Now building a cross to see why for cris the
second CCP pass together with either FRE or DOM or the third CCP pass
do not fix this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-06 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2009-04-06 14:16 ---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-06 Thread rguenth at gcc dot gnu dot org


--- Comment #7 from rguenth at gcc dot gnu dot org  2009-04-06 14:16 ---
Subject: Bug 39643

Author: rguenth
Date: Mon Apr  6 14:16:15 2009
New Revision: 145604

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=145604
Log:
2009-04-06  Richard Guenther  rguent...@suse.de

PR tree-optimization/39643
* tree-ssa-ccp.c (ccp_fold): Fold REALPART_EXPRs and
IMAGPART_EXPRs of complex constants.
(execute_fold_all_builtins): If we folded a call queue
TODO_update_address_taken.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-ccp.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-05 Thread rguenther at suse dot de


--- Comment #1 from rguenther at suse dot de  2009-04-05 18:07 ---
Subject: Re:   New: [4.5 Regression]: cris-elf
 gcc.dg/torture/builtin-math-3.c  -O1 and -Os sincos one

On Sat, 4 Apr 2009, hp at gcc dot gnu dot org wrote:

 With revision 145488 this test passed.
 From revision 145495 and on, this test has failed as follows:
 ...
 Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/dg-torture.exp
 ...
 FAIL: gcc.dg/torture/builtin-math-3.c  -O1  (test for excess errors)
 FAIL: gcc.dg/torture/builtin-math-3.c  -Os  (test for excess errors)
 ...
 
 With the message in gcc.log being:
 builtin-math-3.c:(.text+0x88): undefined reference to `_link_error'
 builtin-math-3.c:(.text+0xfe): undefined reference to `_link_error'
 builtin-math-3.c:(.text+0x174): undefined reference to `_link_error'
 builtin-math-3.c:(.text+0x1aa): undefined reference to `_link_error'
 builtin-math-3.c:(.text+0x220): undefined reference to `_link_error'
 /tmp/ccKBGOIU.o:builtin-math-3.c:(.text+0x296): more undefined references to
 `_link_error' follow
 
 The lack of line-numbers is of course unhelpful, but with -g added, the link
 error becomes, for both -O1 and -Os:
 
 builtin-math-3.o: In function `main':
 /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/builtin-math-3.c:176:
 undefined reference to `_link_error'
 /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/builtin-math-3.c:176:
 undefined reference to `_link_error'
 /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/builtin-math-3.c:177:
 undefined reference to `_link_error'
 /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/builtin-math-3.c:177:
 undefined reference to `_link_error'
 
 Author of patches in suspect revision range CC:ed.

Can you 1) reduce the testcase and attach preprocessed source that
works with a cross-compiler, 2) identify what goes wrong so we don't
have to analyze cris assembler?

Thanks,
Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-05 Thread hp at gcc dot gnu dot org


--- Comment #2 from hp at gcc dot gnu dot org  2009-04-05 22:00 ---
(In reply to comment #1)
 Can you 1) reduce the testcase and attach preprocessed source that
 works with a cross-compiler,

The test-case was already self-contained and had little context-sensitiveness
due to the line-oriented nature, so I didn't expect you to need this.

 2) identify what goes wrong so we don't
 have to analyze cris assembler?

This is a bit worrying.  Surely you didn't think this would ever be needed, for
a test-case where the nature of the failure is that it emits a subroutine call
to link_error()?  Again, the regression is a missing optimization of sincos for
a soft-float target, as already mentioned in the summary and description.

Anyway, one reduced test-case coming up.


-- 

hp at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-04-05 22:00:23
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643



[Bug tree-optimization/39643] [4.5 Regression]: cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one

2009-04-05 Thread hp at gcc dot gnu dot org


--- Comment #3 from hp at gcc dot gnu dot org  2009-04-05 22:05 ---
Created an attachment (id=17591)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17591action=view)
Reduced gcc.dg/torture/builtin-math-3.c

The two lines causing link_error() to be called as in the linker error messages
are cut out and the condition is reduced such that the emitted assembly-code is
still identical.  Compile with e.g. -O1.  Observe libcalls for = and =
being called for constants, while in the pre-regression code, everything is
optimized out to the effect of return 0;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39643