* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
@ 2007-10-01 21:49 ` pinskia at gcc dot gnu dot org
2007-10-02 13:39 ` jakub at gcc dot gnu dot org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-01 21:49 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.2.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
2007-10-01 21:49 ` [Bug tree-optimization/33619] " pinskia at gcc dot gnu dot org
@ 2007-10-02 13:39 ` jakub at gcc dot gnu dot org
2007-10-02 23:30 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-02 13:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jakub at gcc dot gnu dot org 2007-10-02 13:38 -------
Simplified testcase which also fails on x86_64-linux:
/* PR tree-optimization/33619 */
/* { dg-do run } */
/* { dg-options "-O2" } */
#ifdef __powerpc__
# define REG1 "3"
# define REG2 "4"
#elif defined __x86_64__
# define REG1 "rdi"
# define REG2 "rsi"
#endif
static inline void
bar (unsigned long x, int y)
{
register unsigned long p1 __asm__ (REG1) = x;
register unsigned long p2 __asm__ (REG2) = y;
__asm__ volatile ("" : "=r" (p1), "=r" (p2) : "0" (p1), "1" (p2) : "memory");
if (p1 != 0xdeadUL || p2 != 0xbefUL)
__builtin_abort ();
}
__attribute__((const, noinline)) int
baz (int x)
{
return x;
}
__attribute__((noinline)) void
foo (unsigned long *x, int y)
{
unsigned long a = *x;
bar (a, baz (y));
}
int
main (void)
{
unsigned long a = 0xdeadUL;
foo (&a, 0xbefUL);
return 0;
}
In the presence of DECL_HARD_REGISTER vars making any kind of calls, even when
they are const or pure, replaceable is IMHO wrong. Does it buy us anything to
make any calls replaceable (i.e. what would we lose by simply
if (get_call_expr_in (stmt))
return false;
in is_replaceable_p)? If yes, we either need to disallow them if the current
BB ever sets or uses any DECL_HARD_REGISTER vars, or need to do analysis
if the replacement in rewrite_trees crosses any such sets or uses.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
2007-10-01 21:49 ` [Bug tree-optimization/33619] " pinskia at gcc dot gnu dot org
2007-10-02 13:39 ` jakub at gcc dot gnu dot org
@ 2007-10-02 23:30 ` pinskia at gcc dot gnu dot org
2007-10-04 19:05 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-02 23:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-10-02 23:30 -------
Note disabling the replacement for pure/const functions does in fact make this
testcase work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2007-10-02 23:30 ` pinskia at gcc dot gnu dot org
@ 2007-10-04 19:05 ` pinskia at gcc dot gnu dot org
2007-10-05 10:58 ` jakub at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-04 19:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-10-04 19:05 -------
> Does it buy us anything to make any calls replaceable (i.e. what
> would we lose by simply
> if (get_call_expr_in (stmt))
> return false;
> in is_replaceable_p)?
Before 4.2 when loop.c existed, we would lose the ablity for __builtin_expect
working correctly. In 4.2 and above, we "fold" __builtin_expect early on the
tree level and place the info on the edges instead.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2007-10-04 19:05 ` pinskia at gcc dot gnu dot org
@ 2007-10-05 10:58 ` jakub at gcc dot gnu dot org
2007-10-05 17:05 ` pinskia at gmail dot com
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-05 10:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2007-10-05 10:58 -------
If __builtin_expect is the only problem, then we could certainly allow
__builtin_expect to be replaceable (perhaps add a few other builtin calls
that never result in any actual calls, like __builtin_object_size).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-10-05 10:58 ` jakub at gcc dot gnu dot org
@ 2007-10-05 17:05 ` pinskia at gmail dot com
2007-10-07 20:11 ` mmitchel at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gmail dot com @ 2007-10-05 17:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gmail dot com 2007-10-05 17:05 -------
Subject: Re: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
On 5 Oct 2007 10:58:10 -0000, jakub at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #4 from jakub at gcc dot gnu dot org 2007-10-05 10:58 -------
> If __builtin_expect is the only problem, then we could certainly allow
> __builtin_expect to be replaceable (perhaps add a few other builtin calls
> that never result in any actual calls, like __builtin_object_size).
well those should be foldded before exand now so i am not worried about them.
--Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2007-10-05 17:05 ` pinskia at gmail dot com
@ 2007-10-07 20:11 ` mmitchel at gcc dot gnu dot org
2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-10-07 20:11 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2007-10-07 20:11 ` mmitchel at gcc dot gnu dot org
@ 2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
2007-10-12 8:35 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-10-09 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from mmitchel at gcc dot gnu dot org 2007-10-09 19:20 -------
Change target milestone to 4.2.3, as 4.2.2 has been released.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.2 |4.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (7 preceding siblings ...)
2007-10-09 19:30 ` mmitchel at gcc dot gnu dot org
@ 2007-10-12 8:35 ` jakub at gcc dot gnu dot org
2007-10-15 15:15 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-12 8:35 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2007-
| |10/msg00688.html
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-12 08:35:03
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (8 preceding siblings ...)
2007-10-12 8:35 ` jakub at gcc dot gnu dot org
@ 2007-10-15 15:15 ` jakub at gcc dot gnu dot org
2007-10-15 18:49 ` [Bug tree-optimization/33619] [4.1/4.2 " jakub at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-15 15:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jakub at gcc dot gnu dot org 2007-10-15 15:14 -------
Subject: Bug 33619
Author: jakub
Date: Mon Oct 15 15:14:46 2007
New Revision: 129350
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129350
Log:
PR tree-optimization/33619
* tree-ssa-ter.c (is_replaceable_p): Return false for all
calls.
* gcc.dg/pr33619.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr33619.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-ter.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (9 preceding siblings ...)
2007-10-15 15:15 ` jakub at gcc dot gnu dot org
@ 2007-10-15 18:49 ` jakub at gcc dot gnu dot org
2008-02-01 17:00 ` jsm28 at gcc dot gnu dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-15 18:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jakub at gcc dot gnu dot org 2007-10-15 18:49 -------
Fixed so far on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2/4.3 Regression] TER|[4.1/4.2 Regression] TER
|breaks some inline-asm code |breaks some inline-asm code
|(again) |(again)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (10 preceding siblings ...)
2007-10-15 18:49 ` [Bug tree-optimization/33619] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-02-01 17:00 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:29 ` jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-02-01 17:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jsm28 at gcc dot gnu dot org 2008-02-01 16:54 -------
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.3 |4.2.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.1/4.2 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (11 preceding siblings ...)
2008-02-01 17:00 ` jsm28 at gcc dot gnu dot org
@ 2008-05-19 20:29 ` jsm28 at gcc dot gnu dot org
2008-07-04 22:52 ` [Bug tree-optimization/33619] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 22:29 ` jsm28 at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-19 20:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jsm28 at gcc dot gnu dot org 2008-05-19 20:23 -------
4.2.4 is being released, changing milestones to 4.2.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.4 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.2 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (12 preceding siblings ...)
2008-05-19 20:29 ` jsm28 at gcc dot gnu dot org
@ 2008-07-04 22:52 ` jsm28 at gcc dot gnu dot org
2009-03-30 22:29 ` jsm28 at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from jsm28 at gcc dot gnu dot org 2008-07-04 22:51 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2 Regression] TER |[4.2 Regression] TER breaks
|breaks some inline-asm code |some inline-asm code (again)
|(again) |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/33619] [4.2 Regression] TER breaks some inline-asm code (again)
2007-10-01 21:49 [Bug tree-optimization/33619] New: [4.1/4.2/4.3 Regression] TER breaks some inline-asm code (again) pinskia at gcc dot gnu dot org
` (13 preceding siblings ...)
2008-07-04 22:52 ` [Bug tree-optimization/33619] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 22:29 ` jsm28 at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 22:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from jsm28 at gcc dot gnu dot org 2009-03-30 22:29 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail| |4.2.5
Known to work| |4.3.0
Resolution| |FIXED
Target Milestone|4.2.5 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33619
^ permalink raw reply [flat|nested] 16+ messages in thread