public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34966]  New: ICE: verify_ssa fails when optimization trigonometric code
@ 2008-01-25  3:13 dougkwan at google dot com
  2008-01-25  4:03 ` [Bug tree-optimization/34966] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dougkwan at google dot com @ 2008-01-25  3:13 UTC (permalink / raw)
  To: gcc-bugs

I got an internal compiler error when compiling the following.  The function
my_atan is actaully derived from aton expanded from a C libray header. Other
then its name, it is almost identical to atan().


dougkwan@f666g:~/delta-2006.08.03/verify_ssa$ ./gcc -O2 PJ_geos.4.c 
PJ_geos.4.c: In function 'e_forward':
PJ_geos.4.c:22: error: definition in block 2 follows the use
for SSA_NAME: result_9 in statement:
sincostmp.17_15 = __builtin_cexpi (result_9);
PJ_geos.4.c:22: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

--------------------
extern double hypot (double, double);
extern double cos (double);
extern double sin (double);

double
my_atan (double x)
{
  register double result;
  asm volatile ("fld1; fpatan"
                : "=t" (result)
                : "0" (x)
                : "st(1)");
  return result;
}

typedef struct {
   double phi;
} LP;

void
e_forward(LP lp, double x)
{
  lp.phi = my_atan (x);
  x = hypot(cos (lp.phi), sin (lp.phi));
}
---------------------


-- 
           Summary: ICE: verify_ssa fails when optimization trigonometric
                    code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dougkwan at google dot com
 GCC build triplet: i686-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
@ 2008-01-25  4:03 ` pinskia at gcc dot gnu dot org
  2008-01-25  7:50 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-25  4:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org, pinskia at gcc dot gnu
                   |                            |dot org
          Component|c                           |tree-optimization
           Keywords|                            |ice-on-valid-code
            Summary|ICE: verify_ssa fails when  |[4.3 Regression] ICE:
                   |optimization trigonometric  |verify_ssa fails when
                   |code                        |optimization trigonometric
                   |                            |code
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
  2008-01-25  4:03 ` [Bug tree-optimization/34966] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2008-01-25  7:50 ` pinskia at gcc dot gnu dot org
  2008-01-25  8:28 ` dougkwan at google dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-25  7:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-01-25 04:04 -------
*** Bug 34968 has been marked as a duplicate of this bug. ***


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
  2008-01-25  4:03 ` [Bug tree-optimization/34966] [4.3 Regression] " pinskia at gcc dot gnu dot org
  2008-01-25  7:50 ` pinskia at gcc dot gnu dot org
@ 2008-01-25  8:28 ` dougkwan at google dot com
  2008-01-25 10:09 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dougkwan at google dot com @ 2008-01-25  8:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dougkwan at google dot com  2008-01-25 07:49 -------
(In reply to comment #0)

A slightly simpler test case:

--------------
extern double sin (double), cos (double);

__inline double
atan (double __x)
{
  register double __result;
  __asm __volatile__ ("fld1; fpatan" : "=t" (__result) : "0" (__x) : "st(1)");
  return __result;
}

double
f(double x)
{
  double t = atan (x);
  return cos (t) + sin (t);
}
-------------


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
                   ` (2 preceding siblings ...)
  2008-01-25  8:28 ` dougkwan at google dot com
@ 2008-01-25 10:09 ` rguenth at gcc dot gnu dot org
  2008-01-25 12:29 ` rguenth at gcc dot gnu dot org
  2008-01-25 12:32 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-25 10:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-01-25 10:01 -------
Mine.  Actually we do not see the SSA_NAME definition in the asm stmt and so
insert in the wrong place.


-- 

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|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-25 10:01:45
               date|                            |


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
                   ` (3 preceding siblings ...)
  2008-01-25 10:09 ` rguenth at gcc dot gnu dot org
@ 2008-01-25 12:29 ` rguenth at gcc dot gnu dot org
  2008-01-25 12:32 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-25 12:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-01-25 12:09 -------
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=34966


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/34966] [4.3 Regression] ICE: verify_ssa fails when optimization trigonometric code
  2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
                   ` (4 preceding siblings ...)
  2008-01-25 12:29 ` rguenth at gcc dot gnu dot org
@ 2008-01-25 12:32 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-25 12:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-01-25 12:09 -------
Subject: Bug 34966

Author: rguenth
Date: Fri Jan 25 12:08:52 2008
New Revision: 131824

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131824
Log:
2008-01-25  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/34966
        * tree-ssa-math-opts.c (execute_cse_sincos_1): For all but
        default defs and PHI_NODEs we have to insert after the
        defining statement.

        * gcc.c-torture/compile/pr34966.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr34966.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-math-opts.c


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-25 12:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-25  3:13 [Bug c/34966] New: ICE: verify_ssa fails when optimization trigonometric code dougkwan at google dot com
2008-01-25  4:03 ` [Bug tree-optimization/34966] [4.3 Regression] " pinskia at gcc dot gnu dot org
2008-01-25  7:50 ` pinskia at gcc dot gnu dot org
2008-01-25  8:28 ` dougkwan at google dot com
2008-01-25 10:09 ` rguenth at gcc dot gnu dot org
2008-01-25 12:29 ` rguenth at gcc dot gnu dot org
2008-01-25 12:32 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).