public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails
@ 2004-03-12  0:17 kazu at cs dot umass dot edu
  2004-03-12  0:18 ` [Bug optimization/14541] " kazu at cs dot umass dot edu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-12  0:17 UTC (permalink / raw)
  To: gcc-bugs

Here is a reduced testcase.
Basically, link_error won't go away.
This testcase works on mainline, so this is a regression.

extern double log (double);
extern double exp (double);
extern void link_failure (void);

void
test (double d1)
{
  if (log (exp (d1)) != d1)
    link_failure ();
}

int
main (void)
{
  return 0;
}

-- 
           Summary: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: h8300-elf


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


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

* [Bug optimization/14541] [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
@ 2004-03-12  0:18 ` kazu at cs dot umass dot edu
  2004-03-12  0:26 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-12  0:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-03-12 00:18 -------
By the way, I specify -ffast-math on both mainline and tree-ssa to compile
this testcase.


-- 


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


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

* [Bug optimization/14541] [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
  2004-03-12  0:18 ` [Bug optimization/14541] " kazu at cs dot umass dot edu
@ 2004-03-12  0:26 ` pinskia at gcc dot gnu dot org
  2004-03-12  2:40 ` [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level kazu at cs dot umass dot edu
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-12  0:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-12 00:26 -------
Confirmed, the problem is that the builtin expanders do not see log(exp(x)) but rather they see log(T)
where T was set before the call to log to be exp(x).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-12 00:26:10
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
  2004-03-12  0:18 ` [Bug optimization/14541] " kazu at cs dot umass dot edu
  2004-03-12  0:26 ` pinskia at gcc dot gnu dot org
@ 2004-03-12  2:40 ` kazu at cs dot umass dot edu
  2004-03-12 15:30 ` amacleod at redhat dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-12  2:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-03-12 02:40 -------
Removing target because this PR is machine independent.

All of the following fail to be optimized at tree level.

gcc.dg/torture/builtin-explog-1.c
gcc.dg/builtins-10.c
gcc.dg/builtins-26.c
gcc.dg/builtins-7.c

I don't think it's worth creating another PR.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|h8300-elf                   |
            Summary|[tree-ssa]                  |[tree-ssa] built-in math
                   |gcc.dg/torture/builtin-     |functions are not fully
                   |explog-1.c fails            |optimized at tree level


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-03-12  2:40 ` [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level kazu at cs dot umass dot edu
@ 2004-03-12 15:30 ` amacleod at redhat dot com
  2004-03-25  0:09 ` bje at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: amacleod at redhat dot com @ 2004-03-12 15:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amacleod at redhat dot com  2004-03-12 15:30 -------
Which expanders?  

Am I looking at something wrong?  I see optimized tree code:

test (d1)
{
  double T.1;
  double T.0;

<bb 0>:
  if (log (exp (d1<D1066>)) != d1<D1066>) goto <L0>; else goto <L1>;

<L0>:;
  link_failure () [tail call];

<L1>:;
  return;

}


And if I put a breakpoint in  expand_builtin_mathfn() I see:

Breakpoint 4, expand_builtin_mathfn (exp=0x400231e0, target=0x0, subtarget=0x0)
    at /src/tree-ssa/2004-03-09/gcc/gcc/builtins.c:1704
1704	  tree fndecl = get_callee_fndecl (exp);
(gdb) p print_generic_expr (stderr, exp, 64)
log (exp (d1))
$1 = void

Its true that we dont get rid of the link_failure(), but I dont see a temp in
there...

Andrew

-- 


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-03-12 15:30 ` amacleod at redhat dot com
@ 2004-03-25  0:09 ` bje at gcc dot gnu dot org
  2004-05-03 12:37 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bje at gcc dot gnu dot org @ 2004-03-25  0:09 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bje at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-03-25  0:09 ` bje at gcc dot gnu dot org
@ 2004-05-03 12:37 ` pinskia at gcc dot gnu dot org
  2004-05-04  7:56 ` kazu at cs dot umass dot edu
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-03 12:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-03 12:37 -------
Fixed by:
2004-04-30  Richard Henderson  <rth@redhat.com>

        * builtins.c (validate_arglist): Don't reject side effects.
        (simplify_builtin_strcpy): Do reject side effects in length.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2004-05-03 12:37 ` pinskia at gcc dot gnu dot org
@ 2004-05-04  7:56 ` kazu at cs dot umass dot edu
  2004-05-04 11:32 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-05-04  7:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-05-04 07:56 -------
Andrew Pinski, are you sure this is fixed?
I just tried the testcase with the latest tree-ssa branch, and
confirmed that link_error did not go away.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2004-05-04  7:56 ` kazu at cs dot umass dot edu
@ 2004-05-04 11:32 ` pinskia at gcc dot gnu dot org
  2004-05-04 15:52 ` kazu at cs dot umass dot edu
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-04 11:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-04 11:32 -------
Note on the mainline I also need -ffast-math to get rid of the link_error is I think this is not a bug.

-- 


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2004-05-04 11:32 ` pinskia at gcc dot gnu dot org
@ 2004-05-04 15:52 ` kazu at cs dot umass dot edu
  2004-05-04 15:57 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-05-04 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-05-04 15:52 -------
Oops, I forgot -ffast-math.  Still, if I go thourgh a temporary like so:

void
test (double d1)
{
  double tem = exp (d1);
  if (log (tem) != d1)
    link_failure ();
}

the link_failure does not go away even with -ffast-math.


-- 


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


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

* [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (8 preceding siblings ...)
  2004-05-04 15:52 ` kazu at cs dot umass dot edu
@ 2004-05-04 15:57 ` pinskia at gcc dot gnu dot org
  2004-05-24 21:48 ` [Bug tree-optimization/14541] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-04 15:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-04 15:57 -------
Agreed but now this is an enhancement as the mainline does do it either.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
             Status|REOPENED                    |ASSIGNED


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


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

* [Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (9 preceding siblings ...)
  2004-05-04 15:57 ` pinskia at gcc dot gnu dot org
@ 2004-05-24 21:48 ` pinskia at gcc dot gnu dot org
  2004-06-01  1:47 ` pinskia at gcc dot gnu dot org
  2004-06-21  5:15 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24 21:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-24 01:18 -------
Mine as I am working on the tree combiner and since fold already works for this there is no need for 
anything else.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |15459
         AssignedTo|bje at gcc dot gnu dot org  |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|3.5.0                       |---


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


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

* [Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (10 preceding siblings ...)
  2004-05-24 21:48 ` [Bug tree-optimization/14541] " pinskia at gcc dot gnu dot org
@ 2004-06-01  1:47 ` pinskia at gcc dot gnu dot org
  2004-06-21  5:15 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-01  1:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-01 01:47 -------
Ok, I just confirmed that my new patch for PR 15459 fixes this.

-- 


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


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

* [Bug tree-optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level
  2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
                   ` (11 preceding siblings ...)
  2004-06-01  1:47 ` pinskia at gcc dot gnu dot org
@ 2004-06-21  5:15 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-21  5:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-21 05:15 -------
Will submit my tree combiner pass which fixes this.

-- 


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


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

end of thread, other threads:[~2004-06-21  5:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-12  0:17 [Bug optimization/14541] New: [tree-ssa] gcc.dg/torture/builtin-explog-1.c fails kazu at cs dot umass dot edu
2004-03-12  0:18 ` [Bug optimization/14541] " kazu at cs dot umass dot edu
2004-03-12  0:26 ` pinskia at gcc dot gnu dot org
2004-03-12  2:40 ` [Bug optimization/14541] [tree-ssa] built-in math functions are not fully optimized at tree level kazu at cs dot umass dot edu
2004-03-12 15:30 ` amacleod at redhat dot com
2004-03-25  0:09 ` bje at gcc dot gnu dot org
2004-05-03 12:37 ` pinskia at gcc dot gnu dot org
2004-05-04  7:56 ` kazu at cs dot umass dot edu
2004-05-04 11:32 ` pinskia at gcc dot gnu dot org
2004-05-04 15:52 ` kazu at cs dot umass dot edu
2004-05-04 15:57 ` pinskia at gcc dot gnu dot org
2004-05-24 21:48 ` [Bug tree-optimization/14541] " pinskia at gcc dot gnu dot org
2004-06-01  1:47 ` pinskia at gcc dot gnu dot org
2004-06-21  5:15 ` pinskia 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).