public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions
@ 2014-05-11  1:30 bugdal at aerifal dot cx
  2014-05-11  3:20 ` [Bug c/61144] " pinskia at gcc dot gnu.org
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-11  1:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61144
           Summary: Invalid optimizations for extern vars with local weak
                    definitions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx

GCC 4.8.2 introduced a bug in optimization (present at all -O levels except
-O0) in the presence of extern objects with weak definitions local to the
translation unit. The bug is also present in 4.9.0. The following minimal
testcase shows the problem:

static int dummy = 0;
extern int foo __attribute__((__weak__, __alias__("dummy")));
int bar() { if (foo) return 1; return 0; }

This should produce a nontrivial bar which can conditionally return 0 or 1
depending on the contents of foo. Instead, on gcc 4.8.2 and 4.9.0, it produces
a function which always returns 0.

GCC versions with this bug have been reported to produce a seriously broken
libc.a/libc.so for musl libc (e.g. fflush(NULL) fails to flush stdout).

Removing static above causes the symptom to go away, so presumably GCC is
wrongly transferring knowledge that "dummy" is static onto "foo", and thereby
assuming "foo" is not externally reachable/modifiable. IIRC clang/LLVM had the
same bug a couple years back and fixed it; it looks like GCC has newly
introduced it.

I don't know what component this should be marked as; sadly there's no
"unknown" option so I just put "c". It should presumably be on one of the
optimization ones, but I'm not sure which.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
@ 2014-05-11  3:20 ` pinskia at gcc dot gnu.org
  2014-05-11  3:32 ` bugdal at aerifal dot cx
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-05-11  3:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
dummy is not weak or even extern.  foo is but it is an alias to dummy which
means it is also static rather than extern or weak.  if dummy was an alias to
foo which was weak and extern then GCC would not optimize the code.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
  2014-05-11  3:20 ` [Bug c/61144] " pinskia at gcc dot gnu.org
@ 2014-05-11  3:32 ` bugdal at aerifal dot cx
  2014-05-11  3:33 ` bugdal at aerifal dot cx
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-11  3:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> ---
dummy is relevant because there is no reference to dummy except the weak alias.
foo is extern and the reference is to foo. It has a weak definition local to
the translation unit (provided by the weak alias) but this can be overridden.
GCC has handled this correctly ever since 2.x; 4.8.2 is the first version to
mess it up.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
  2014-05-11  3:20 ` [Bug c/61144] " pinskia at gcc dot gnu.org
  2014-05-11  3:32 ` bugdal at aerifal dot cx
@ 2014-05-11  3:33 ` bugdal at aerifal dot cx
  2014-05-11 19:05 ` bugdal at aerifal dot cx
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-11  3:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Rich Felker <bugdal at aerifal dot cx> ---
That should have read "dummy is irrelevant".


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (2 preceding siblings ...)
  2014-05-11  3:33 ` bugdal at aerifal dot cx
@ 2014-05-11 19:05 ` bugdal at aerifal dot cx
  2014-05-11 19:41 ` pinskia at gcc dot gnu.org
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-11 19:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Rich Felker <bugdal at aerifal dot cx> ---
Some users have been unable to reproduce the issue with gcc 4.8.2. Is it
possible that building with/without isl/cloog libraries (or other third-party
optimization-related libaries or plugins?) could affect this, and is there any
good way to tell if gcc was built to use such things?


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (3 preceding siblings ...)
  2014-05-11 19:05 ` bugdal at aerifal dot cx
@ 2014-05-11 19:41 ` pinskia at gcc dot gnu.org
  2014-05-11 20:05 ` bugdal at aerifal dot cx
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-05-11 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A weak alias to a non global variable does not make sense.  As it can never be
overridden.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (4 preceding siblings ...)
  2014-05-11 19:41 ` pinskia at gcc dot gnu.org
@ 2014-05-11 20:05 ` bugdal at aerifal dot cx
  2014-05-12  4:18 ` cloos at jhcloos dot com
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-11 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> ---
The alias is global and it can be overridden (in the case of the test case, by
any external object named "foo" in any other translation unit). The static in
the definition of dummy does NOT apply to the alias foo, and never has. This is
easy to verify, and it's frustrating that you're attacking this bug report
which is clearly a regression from a standpoint of not understanding the
semantics of the alias attribute.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (5 preceding siblings ...)
  2014-05-11 20:05 ` bugdal at aerifal dot cx
@ 2014-05-12  4:18 ` cloos at jhcloos dot com
  2014-05-12 13:23 ` jody at jodybruchon dot com
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cloos at jhcloos dot com @ 2014-05-12  4:18 UTC (permalink / raw)
  To: gcc-bugs

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

James Cloos <cloos at jhcloos dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cloos at jhcloos dot com

--- Comment #7 from James Cloos <cloos at jhcloos dot com> ---
This seems to be a post-4.8.2 change.

(At least, it doesn’t show up on the Debian and Gentoo versions of 4.8.2.)

It does show up on Deb’s version of 4.9 and their compile from the 4.10 branch.
>From gcc-bugs-return-451278-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 12 05:52:54 2014
Return-Path: <gcc-bugs-return-451278-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 645 invoked by alias); 12 May 2014 05:52:53 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 619 invoked by uid 48); 12 May 2014 05:52:47 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61150] New: wrong code at -O3 on x86_64-linux
Date: Mon, 12 May 2014 05:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: su at cs dot ucdavis.edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-61150-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-05/txt/msg00970.txt.bz2
Content-length: 1407

http://gcc.gnu.org/bugzilla/show_bug.cgi?ida150

            Bug ID: 61150
           Summary: wrong code at -O3 on x86_64-linux
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk miscompiles the following code on x86_64-linux at -O3 in
both 32-bit and 64-bit modes.

This is a regression from 4.9.x.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140511 (experimental) [trunk revision 210307] (GCC)
$
$ gcc-trunk -O2 small.c; a.out
0
$ gcc-4.9.0 -O3 small.c; a.out
0
$
$ gcc-trunk -O3 small.c; a.out
1
$


--------------------------------


int printf (const char *, ...);

int a, b, c, d = 1;

int
main ()
{
  int e = d;
  for (b = 0; b < 5; b++)
    {
      for (a = 0; a < 1; a++)
        {
          if (e)
            break;
          for (c = 0; c < 1; c++)
            ;
        }
      e |= 1;
    }
  printf ("%d\n", c);
  return 0;
}


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (6 preceding siblings ...)
  2014-05-12  4:18 ` cloos at jhcloos dot com
@ 2014-05-12 13:23 ` jody at jodybruchon dot com
  2014-05-12 13:59 ` cloos at jhcloos dot com
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: jody at jodybruchon dot com @ 2014-05-12 13:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jody Lee Bruchon <jody at jodybruchon dot com> ---
For my gcc versions (x86_64) compiled from release sources, I have the
following for this testcase, with and without static, using -O2:

=== gcc 4.8.2, with and without static ===

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.2/configure --prefix=/usr --mandir=/usr/man
--libexecdir=/usr/lib --enable-languages=c,c++,objc --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-shared --disable-nls
--with-x=no --with-system-zlib --disable-multilib --disable-bootstrap
--disable-debug
Thread model: posix
gcc version 4.8.2 (GCC)

$ objdump -dr test.o

test.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <bar>:
   0:   8b 15 00 00 00 00       mov    0x0(%rip),%edx        # 6 <bar+0x6>
                        2: R_X86_64_PC32        foo-0x4
   6:   31 c0                   xor    %eax,%eax
   8:   85 d2                   test   %edx,%edx
   a:   0f 95 c0                setne  %al
   d:   c3                      retq

=== gcc 4.9.0 ===

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.9.0/configure --prefix=/usr --mandir=/usr/man
--libexecdir=/usr/lib --enable-languages=c,c++,objc --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-shared --disable-nls
--with-x=no --with-system-zlib --disable-multilib --disable-debug
Thread model: posix
gcc version 4.9.0 (GCC)

=== With static (4.9.0) ===

$ objdump -dr test.o

test.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <bar>:
   0:   31 c0                   xor    %eax,%eax
   2:   c3                      retq

=== Without static (4.9.0) ===

$ objdump -dr test.o

test.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <bar>:
   0:   8b 15 00 00 00 00       mov    0x0(%rip),%edx        # 6 <bar+0x6>
                        2: R_X86_64_PC32        foo-0x4
   6:   31 c0                   xor    %eax,%eax
   8:   85 d2                   test   %edx,%edx
   a:   0f 95 c0                setne  %al
   d:   c3                      retq


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (7 preceding siblings ...)
  2014-05-12 13:23 ` jody at jodybruchon dot com
@ 2014-05-12 13:59 ` cloos at jhcloos dot com
  2014-05-12 17:42 ` bugdal at aerifal dot cx
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: cloos at jhcloos dot com @ 2014-05-12 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from James Cloos <cloos at jhcloos dot com> ---
My tests on debian sid with GCC: (Debian 4.8.2-21) 4.8.2 do not replicate the
bug.

On debian sid, only 4.9 and gcc-snapshot (the 4.10 branch) show the bug.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (8 preceding siblings ...)
  2014-05-12 13:59 ` cloos at jhcloos dot com
@ 2014-05-12 17:42 ` bugdal at aerifal dot cx
  2014-05-12 19:02 ` bugdal at aerifal dot cx
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-12 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Rich Felker <bugdal at aerifal dot cx> ---
Furthermore, __builtin_constant_p(dummy) wrongly returns 1, even though dummy
is modifiable externally via foo (assuming foo is not replaced by a strong
definition elsewhere). Perhaps this should be filed as a separate bug since
it's also user-visible, but I think the cause is the same.

On the other hand, according to my tests on gcc.godbolt.org, the incorrect
value for __builtin_constant_p predates the optimization bug. This could mean
they're separate bugs, but I suspect the later changes that cause the
optimization bug were "correct" except that they're using the wrong concept of
"is this expression constant?" from the earlier bug.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (9 preceding siblings ...)
  2014-05-12 17:42 ` bugdal at aerifal dot cx
@ 2014-05-12 19:02 ` bugdal at aerifal dot cx
  2014-05-12 20:31 ` glisse at gcc dot gnu.org
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-12 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Rich Felker <bugdal at aerifal dot cx> ---
I've added the related issue 61159.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (10 preceding siblings ...)
  2014-05-12 19:02 ` bugdal at aerifal dot cx
@ 2014-05-12 20:31 ` glisse at gcc dot gnu.org
  2014-05-13  3:26 ` bugdal at aerifal dot cx
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-05-12 20:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #14 from Marc Glisse <glisse at gcc dot gnu.org> ---
This seems related to PR 59948 where Honza says the code is "really broken".


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (11 preceding siblings ...)
  2014-05-12 20:31 ` glisse at gcc dot gnu.org
@ 2014-05-13  3:26 ` bugdal at aerifal dot cx
  2014-05-13  8:45 ` glisse at gcc dot gnu.org
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-13  3:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #15 from Rich Felker <bugdal at aerifal dot cx> ---
Can you clarify? As far as I can tell, the other bug is a missed optimization
and this is an overly-aggressive, incorrect optimization.


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

* [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (12 preceding siblings ...)
  2014-05-13  3:26 ` bugdal at aerifal dot cx
@ 2014-05-13  8:45 ` glisse at gcc dot gnu.org
  2014-05-13 11:19 ` [Bug ipa/61144] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-05-13  8:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #16 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Rich Felker from comment #15)
> Can you clarify? As far as I can tell, the other bug is a missed
> optimization and this is an overly-aggressive, incorrect optimization.

The same test is wrong, it optimizes cases it shouldn't and doesn't optimize
cases it should (I am not familiar enough to tell, just trusting you), goes
together. Having testcases in both directions will be useful when Jan (or
someone else) rewrites it.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (13 preceding siblings ...)
  2014-05-13  8:45 ` glisse at gcc dot gnu.org
@ 2014-05-13 11:19 ` rguenth at gcc dot gnu.org
  2014-05-14  5:08 ` bugdal at aerifal dot cx
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-13 11:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.8.2
            Version|unknown                     |4.9.0
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2014-05-13
          Component|c                           |ipa
                 CC|                            |hubicka at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|Invalid optimizations for   |[4.9/4.10 Regression]
                   |extern vars with local weak |Invalid optimizations for
                   |definitions                 |extern vars with local weak
                   |                            |definitions
   Target Milestone|---                         |4.9.1
      Known to fail|                            |4.9.0

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed for 4.9.0.  Note that I agree that the testcase looks suspicious,
but weak aliases have odd behavior.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (14 preceding siblings ...)
  2014-05-13 11:19 ` [Bug ipa/61144] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
@ 2014-05-14  5:08 ` bugdal at aerifal dot cx
  2014-05-20  8:31 ` bugdal at aerifal dot cx
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-14  5:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #18 from Rich Felker <bugdal at aerifal dot cx> ---
Any ideas on how to reliably test for this bug without having to run programs
(breaks cross-compiling) or use additional tools (nm, objdump, etc. which we
don't already depend on) to detect it? Since this issue was raised in relation
to musl libc we're holding up the pending release trying to decide how best to
work around it. My hope is to simply reject the broken version(s) with a
message to try -fno-toplevel-reorder, and I could just hard-code 4.9.0 as the
only broken version if folks on the GCC side are willing to make sure this gets
fixed in time for 4.9.1, but obviously having a test for the bug would be
preferable.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (15 preceding siblings ...)
  2014-05-14  5:08 ` bugdal at aerifal dot cx
@ 2014-05-20  8:31 ` bugdal at aerifal dot cx
  2014-05-20 20:28 ` bugdal at aerifal dot cx
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-20  8:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #20 from Rich Felker <bugdal at aerifal dot cx> ---
On further investigation, it looks like the code I cited deals with strong
aliases as well as weak ones, and in the strong alias case, the strong folding
behavior might be desirable. A better fix seems to be adding an explicit check
for weak aliases (DECL_WEAK(decl)) when an alias is found and returning
error_mark_node in that case.

Note that prior to the above-mentioned commit, the !TREE_READONLY(decl) case
was always treated as non-foldable, so there seems to have been no subtlety to
avoiding errors with weak aliases. But the new code performs much more
aggressive constant folding and thus needs to avoid stepping on weak aliases.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (16 preceding siblings ...)
  2014-05-20  8:31 ` bugdal at aerifal dot cx
@ 2014-05-20 20:28 ` bugdal at aerifal dot cx
  2014-06-26 13:05 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-05-20 20:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #21 from Rich Felker <bugdal at aerifal dot cx> ---
Created attachment 32830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32830&action=edit
proposed patch

patch is generated against the revision that introduced this bug.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (17 preceding siblings ...)
  2014-05-20 20:28 ` bugdal at aerifal dot cx
@ 2014-06-26 13:05 ` rguenth at gcc dot gnu.org
  2014-06-26 13:36 ` bugdal at aerifal dot cx
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-26 13:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (18 preceding siblings ...)
  2014-06-26 13:05 ` rguenth at gcc dot gnu.org
@ 2014-06-26 13:36 ` bugdal at aerifal dot cx
  2014-07-02 12:23 ` patrick at parcs dot ath.cx
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-06-26 13:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #22 from Rich Felker <bugdal at aerifal dot cx> ---
> Richard Biener <rguenth at gcc dot gnu.org> changed:
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Priority|P3                          |P2

Can we please make this P1 rather than P2? It is a wrong-code
regression and only present in a single release, so by the bug
management guidelines (https://gcc.gnu.org/bugs/management.html) I
think it should be P1.

There is already a working patch, test-case, and discussion on the
gcc-patches list so I don't see what's blocking fixing it before the
next release.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (19 preceding siblings ...)
  2014-06-26 13:36 ` bugdal at aerifal dot cx
@ 2014-07-02 12:23 ` patrick at parcs dot ath.cx
  2014-07-02 14:47 ` bugdal at aerifal dot cx
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: patrick at parcs dot ath.cx @ 2014-07-02 12:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

patrick at parcs dot ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |patrick at parcs dot ath.cx

--- Comment #23 from patrick at parcs dot ath.cx ---
(In reply to Rich Felker from comment #22)
> > Richard Biener <rguenth at gcc dot gnu.org> changed:
> >            What    |Removed                     |Added
> > ----------------------------------------------------------------------------
> >            Priority|P3                          |P2
> 
> Can we please make this P1 rather than P2? It is a wrong-code
> regression and only present in a single release, so by the bug
> management guidelines (https://gcc.gnu.org/bugs/management.html) I
> think it should be P1.
> 
> There is already a working patch, test-case, and discussion on the
> gcc-patches list so I don't see what's blocking fixing it before the
> next release.

It looks like this bug has been recently fixed in the trunk (no testsuite
addition however).  I'm not sure what its status is on the release branches,
though.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (20 preceding siblings ...)
  2014-07-02 12:23 ` patrick at parcs dot ath.cx
@ 2014-07-02 14:47 ` bugdal at aerifal dot cx
  2014-07-14 16:12 ` amonakov at gcc dot gnu.org
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-07-02 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #24 from Rich Felker <bugdal at aerifal dot cx> ---
On Wed, Jul 02, 2014 at 12:22:40PM +0000, patrick at parcs dot ath.cx wrote:
> It looks like this bug has been recently fixed in the trunk (no testsuite
> addition however).  I'm not sure what its status is on the release branches,
> though.

Per discussion on gcc-patches, the issue for this exact test case went
away due to related changes not explicitly aimed at fixing this bug.
However, if dummy is const-qualified, the bug supposedly remains. I
have not yet tested with trunk to confirm this; I can do that if
necessary.

Here is the new test case:

static const int dummy = 0;
extern const int foo __attribute__((__weak__, __alias__("dummy")));
int bar() { if (foo) return 1; return 0; }

Even with the const qualifier on both dummy and foo, foo should not be
considered for constant folding because it's replaceable by alternate
definitions which may provide different values.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (21 preceding siblings ...)
  2014-07-02 14:47 ` bugdal at aerifal dot cx
@ 2014-07-14 16:12 ` amonakov at gcc dot gnu.org
  2014-07-14 16:13 ` amonakov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: amonakov at gcc dot gnu.org @ 2014-07-14 16:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #25 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
I have tried to bootstrap and regtest the patch (to be attached) that reflects
the latest comments on the mailing list (except the concern raised by Jan about
C++ optimization).  Unfortunately the patch regresses the following simple C++
testcase, not folding the conditional access to the constant (even at -O3), but
not emitting the constant either and thus causing an undefined reference at
link time.  Uncommenting the commented line allows folding but also emits the
definition of the static member, increasing .rodata size.

It seems odd to me that decl_replaceable_p(z::cst) is true, and that for
instance TREE_PUBLIC(z::cst) is true.  Any help here please?

struct z {
  static const int cst = 1;
};

// const int z::cst;

int foo(int cond)
{
  return cond ? z::cst : 0;
}


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (22 preceding siblings ...)
  2014-07-14 16:12 ` amonakov at gcc dot gnu.org
@ 2014-07-14 16:13 ` amonakov at gcc dot gnu.org
  2014-07-16 13:30 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: amonakov at gcc dot gnu.org @ 2014-07-14 16:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32830|0                           |1
        is obsolete|                            |

--- Comment #26 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Created attachment 33120
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33120&action=edit
updated patch


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (23 preceding siblings ...)
  2014-07-14 16:13 ` amonakov at gcc dot gnu.org
@ 2014-07-16 13:30 ` jakub at gcc dot gnu.org
  2014-07-16 18:17 ` bugdal at aerifal dot cx
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-16 13:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.1                       |4.9.2

--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.1 has been released.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (24 preceding siblings ...)
  2014-07-16 13:30 ` jakub at gcc dot gnu.org
@ 2014-07-16 18:17 ` bugdal at aerifal dot cx
  2014-07-30  9:14 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-07-16 18:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #28 from Rich Felker <bugdal at aerifal dot cx> ---
I'm quite disappointed that another release was made with this bug present.
I've been trying to find a workaround, but even at -O0 the invalid constant
folding optimizations are made. Is there anything I can do short of
blacklisting 4.9.0 and 4.9.1 (either hard-coded or via detecting the bug)?


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (25 preceding siblings ...)
  2014-07-16 18:17 ` bugdal at aerifal dot cx
@ 2014-07-30  9:14 ` hubicka at gcc dot gnu.org
  2014-07-31 22:56 ` bugdal at aerifal dot cx
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-07-30  9:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #29 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Created attachment 33209
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33209&action=edit
patch I am testing

Sorry for taking so long on this issue - I had busy time and there is no really
good answer to this problem.  C++ require constant variables to be folded, ELF
interposition interpreted in full generality prevents folding of many symbols. 
We behave in C++ way for years and I think it should stay a default, so I think
we can special case the user specified WEAK attribute - i.e. do not give up on
PIC exported symbols nor C++ COMDATs as we already special case COMDAT.

I hope this won't break non-ELF targets, like AIX - will give it a try.


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

* [Bug ipa/61144] [4.9/4.10 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (26 preceding siblings ...)
  2014-07-30  9:14 ` hubicka at gcc dot gnu.org
@ 2014-07-31 22:56 ` bugdal at aerifal dot cx
  2014-10-05  4:56 ` [Bug ipa/61144] [4.9/5 " hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: bugdal at aerifal dot cx @ 2014-07-31 22:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #30 from Rich Felker <bugdal at aerifal dot cx> ---
I don't really understand how weak aliases come into play for implementing C++
features, but if their semantics are not identical to the necessary C++
semantics, the compiler should just distinguish between the relevant C++
semantics and weak alias semantics rather than trying to force two semantically
different concepts to use the same feature in ways that breaks either one or
the other.

Also, was C++ behavior broken prior to 4.9.0, or is there some other reason
that weak aliases worked without breaking C++ mandatory constant folding prior
to 4.9.0?


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

* [Bug ipa/61144] [4.9/5 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (29 preceding siblings ...)
  2014-10-05  4:56 ` hubicka at gcc dot gnu.org
@ 2014-10-05  4:56 ` hubicka at gcc dot gnu.org
  2014-10-05  4:58 ` hubicka at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-10-05  4:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #31 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Sun Oct  5 04:52:19 2014
New Revision: 215896

URL: https://gcc.gnu.org/viewcvs?rev=215896&root=gcc&view=rev
Log:

    PR ipa/61144
    * varpool.c (ctor_for_folding): Do not fold WEAK symbols.
    * gcc.dg/tree-ssa/pr61144.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/varpool.c

--- Comment #32 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.

--- Comment #33 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.


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

* [Bug ipa/61144] [4.9/5 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (28 preceding siblings ...)
  2014-10-05  4:56 ` [Bug ipa/61144] [4.9/5 " hubicka at gcc dot gnu.org
@ 2014-10-05  4:56 ` hubicka at gcc dot gnu.org
  2014-10-05  4:56 ` hubicka at gcc dot gnu.org
  2014-10-05  4:58 ` hubicka at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-10-05  4:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #31 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Sun Oct  5 04:52:19 2014
New Revision: 215896

URL: https://gcc.gnu.org/viewcvs?rev=215896&root=gcc&view=rev
Log:

    PR ipa/61144
    * varpool.c (ctor_for_folding): Do not fold WEAK symbols.
    * gcc.dg/tree-ssa/pr61144.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/varpool.c

--- Comment #32 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.

--- Comment #33 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.


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

* [Bug ipa/61144] [4.9/5 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (27 preceding siblings ...)
  2014-07-31 22:56 ` bugdal at aerifal dot cx
@ 2014-10-05  4:56 ` hubicka at gcc dot gnu.org
  2014-10-05  4:56 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-10-05  4:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #31 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Sun Oct  5 04:52:19 2014
New Revision: 215896

URL: https://gcc.gnu.org/viewcvs?rev=215896&root=gcc&view=rev
Log:

    PR ipa/61144
    * varpool.c (ctor_for_folding): Do not fold WEAK symbols.
    * gcc.dg/tree-ssa/pr61144.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/varpool.c

--- Comment #32 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.

--- Comment #33 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed now both on branch and mainline.


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

* [Bug ipa/61144] [4.9/5 Regression] Invalid optimizations for extern vars with local weak definitions
  2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
                   ` (30 preceding siblings ...)
  2014-10-05  4:56 ` hubicka at gcc dot gnu.org
@ 2014-10-05  4:58 ` hubicka at gcc dot gnu.org
  31 siblings, 0 replies; 33+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-10-05  4:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144

--- Comment #34 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Sun Oct  5 04:56:14 2014
New Revision: 215897

URL: https://gcc.gnu.org/viewcvs?rev=215897&root=gcc&view=rev
Log:

    PR ipa/61144
    * gcc.dg/tree-ssa/pr61144.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c
Modified:
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2014-10-05  4:58 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-11  1:30 [Bug c/61144] New: Invalid optimizations for extern vars with local weak definitions bugdal at aerifal dot cx
2014-05-11  3:20 ` [Bug c/61144] " pinskia at gcc dot gnu.org
2014-05-11  3:32 ` bugdal at aerifal dot cx
2014-05-11  3:33 ` bugdal at aerifal dot cx
2014-05-11 19:05 ` bugdal at aerifal dot cx
2014-05-11 19:41 ` pinskia at gcc dot gnu.org
2014-05-11 20:05 ` bugdal at aerifal dot cx
2014-05-12  4:18 ` cloos at jhcloos dot com
2014-05-12 13:23 ` jody at jodybruchon dot com
2014-05-12 13:59 ` cloos at jhcloos dot com
2014-05-12 17:42 ` bugdal at aerifal dot cx
2014-05-12 19:02 ` bugdal at aerifal dot cx
2014-05-12 20:31 ` glisse at gcc dot gnu.org
2014-05-13  3:26 ` bugdal at aerifal dot cx
2014-05-13  8:45 ` glisse at gcc dot gnu.org
2014-05-13 11:19 ` [Bug ipa/61144] [4.9/4.10 Regression] " rguenth at gcc dot gnu.org
2014-05-14  5:08 ` bugdal at aerifal dot cx
2014-05-20  8:31 ` bugdal at aerifal dot cx
2014-05-20 20:28 ` bugdal at aerifal dot cx
2014-06-26 13:05 ` rguenth at gcc dot gnu.org
2014-06-26 13:36 ` bugdal at aerifal dot cx
2014-07-02 12:23 ` patrick at parcs dot ath.cx
2014-07-02 14:47 ` bugdal at aerifal dot cx
2014-07-14 16:12 ` amonakov at gcc dot gnu.org
2014-07-14 16:13 ` amonakov at gcc dot gnu.org
2014-07-16 13:30 ` jakub at gcc dot gnu.org
2014-07-16 18:17 ` bugdal at aerifal dot cx
2014-07-30  9:14 ` hubicka at gcc dot gnu.org
2014-07-31 22:56 ` bugdal at aerifal dot cx
2014-10-05  4:56 ` [Bug ipa/61144] [4.9/5 " hubicka at gcc dot gnu.org
2014-10-05  4:56 ` hubicka at gcc dot gnu.org
2014-10-05  4:56 ` hubicka at gcc dot gnu.org
2014-10-05  4:58 ` hubicka at gcc dot gnu.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).