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

            Bug ID: 62035
           Summary: [4.9 Regresion] wrong code building libapache-mod-perl
                    with -O1, works with -O1 -fno-tree-dse
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

Created attachment 33260
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33260&action=edit
test case

[forwarded from http://bugs.debian.org/754901]

libapache2-mod-perl2 build segfaults in the test suite when built with gcc 4.9
(r213317) with -O1 or higher, building with -O1 -fno-tree-dse works around it.
seen at least on x86_64-linux-gnu.

attributing one function with

__attribute__((optimize("-fno-tree-dse")))
modperl_enc.c (modperl_env_table_populate)

is enough to avoid the segfaults in the test suite. The diff in the assembler
is:

--- ok/modperl_env.s    2014-08-06 12:42:36.714269110 +0000
+++ bad/modperl_env.s   2014-08-06 12:40:44.441445210 +0000
@@ -118,7 +118,6 @@
 .LVL15:
        movq    %rax, %r14
 .LVL16:
-       movq    %rax, 40(%rsp)
        subq    $8, %rsp
        .cfi_def_cfa_offset 120
        pushq   $0

Reply via email to