public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/60449] New: Merging function DECLs discards leaf attribute which causes cfg verifier to fail
Date: Thu, 06 Mar 2014 17:03:00 -0000	[thread overview]
Message-ID: <bug-60449-4@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3891 bytes --]

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

            Bug ID: 60449
           Summary: Merging function DECLs discards leaf attribute which
                    causes cfg verifier to fail
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org

I've come across this verify_flow_info failure when attempting to LTO
build Firefox.  I'm attaching a small testcase (I'm using trunk
revision 208276 on x86-64-linux), to reproduce do:

$ ~/gcc/trunk/inst/bin/gcc -c -O2 -flto gtod1.c 
$ ~/gcc/trunk/inst/bin/gcc -c -O2 -flto gtod2.c
$ ~/gcc/trunk/inst/bin/gcc -O2 -flto gtod1.o gtod2.o 
gtod2.c: In function ‘main’:
gtod2.c:41:5: error: control flow in the middle of basic block 6
 int main (void)
     ^
gtod2.c:41:5: error: control flow in the middle of basic block 6
gtod2.c:41:5: error: control flow in the middle of basic block 6
gtod2.c:41:5: internal compiler error: verify_flow_info failed

The order of .o files in the linking stage is important.

My artificial testcase declares gettimeofday itself, twice, each time
with different attributes on purpose.  When building FF, all
declarations claim to come from /usr/include/sys/time.h, I do not know
why some of them lost or did not get their attributes.

The problem with loosing the leaf attribute is that calls from
function that calls setjmp are considered control flow statements
unless they are without side effects or leaf (see stmt_ends_bb_p,
is_ctrl_altering_stmt and call_can_make_abnormal_goto).  Therefore, if
a leaf attribute is lost, calls to that functions suddenly may need to
break BBs or face the verifiers wrath.
>From gcc-bugs-return-445643-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 06 17:04:15 2014
Return-Path: <gcc-bugs-return-445643-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30988 invoked by alias); 6 Mar 2014 17:04:15 -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 30978 invoked by uid 48); 6 Mar 2014 17:04:12 -0000
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail
Date: Thu, 06 Mar 2014 17:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jamborm at gcc dot gnu.org
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: attachments.created
Message-ID: <bug-60449-4-08xe8knbmx@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60449-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60449-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-03/txt/msg00512.txt.bz2
Content-length: 237

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`449

--- Comment #1 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Created attachment 32289
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id2289&actioníit
Part one of a testcase


             reply	other threads:[~2014-03-06 17:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 17:03 jamborm at gcc dot gnu.org [this message]
2014-03-06 17:04 ` [Bug lto/60449] " jamborm at gcc dot gnu.org
2014-03-06 17:42 ` trippels at gcc dot gnu.org
2014-03-06 17:47 ` jamborm at gcc dot gnu.org
2014-03-07  8:55 ` rguenth at gcc dot gnu.org
2014-03-07  8:56 ` rguenth at gcc dot gnu.org
2014-03-07 10:07 ` jamborm at gcc dot gnu.org
2014-04-01 12:29 ` rguenth at gcc dot gnu.org
2014-04-01 12:30 ` rguenth at gcc dot gnu.org
2014-04-01 12:36 ` rguenth at gcc dot gnu.org
2014-04-22 11:35 ` jakub at gcc dot gnu.org
2014-06-12  8:09 ` mliska at suse dot cz
2014-06-24 14:41 ` jamborm at gcc dot gnu.org
2014-07-16 13:26 ` jakub at gcc dot gnu.org
2014-08-20 16:47 ` wmi at gcc dot gnu.org
2014-08-20 17:10 ` wmi at gcc dot gnu.org
2014-10-30 10:36 ` jakub at gcc dot gnu.org
2014-11-25 15:21 ` jamborm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60449-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).