public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60937] New: -Os -fprofile-arcs breaks __attribute__((error()))
@ 2014-04-23 11:50 kirill at shutemov dot name
  2021-12-05  9:08 ` [Bug middle-end/60937] " pinskia at gcc dot gnu.org
  2021-12-09  9:23 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: kirill at shutemov dot name @ 2014-04-23 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60937
           Summary: -Os -fprofile-arcs breaks __attribute__((error()))
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kirill at shutemov dot name

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

Use of -Os and -fprofile-arcs break __attribute__((error())) behavior on
attached test case. It false-positively triggers compile time error:

$ gcc -Wall -Os -fprofile-arcs -c -o mm/.tmp_gup.o gup.i
gup.i: In function ‘__get_user_pages’:
gup.i:29:44: error: call to ‘__compiletime_assert’ declared with attribute
error: BUILD_BUG failed
                        __compiletime_assert();

Switching to other optimization level (above 0) or remove -fprofile-arcs does
not lead to that:

$ gcc -Wall -O1 -fprofile-arcs -c -o mm/.tmp_gup.o gup.i
$ gcc -Wall -Os -c -o mm/.tmp_gup.o gup.i
>From gcc-bugs-return-449687-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 23 11:52:43 2014
Return-Path: <gcc-bugs-return-449687-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19295 invoked by alias); 23 Apr 2014 11:52:43 -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 19252 invoked by uid 48); 23 Apr 2014 11:52:40 -0000
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/60911] [4.9/4.10 Regression] wrong code with -O2 -flto -fipa-pta
Date: Wed, 23 Apr 2014 11:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jamborm at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.1
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60911-4-Cuela8uxwS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60911-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60911-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-04/txt/msg01707.txt.bz2
Content-length: 943

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

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> Late IPA passes need all regular IPA transforms applied and clones
> materialized.

I agree that would make sense but it is not what we do.  Just look at
compile() in cgraphunit.c.  When late IPA passes run, clones are
already materialized but transformation phases of regular IPA passes
have not been run yet.  Apart from the fact that late-IPA passes do
not see the bodies transformed and inlining performed it also means
that call statements have not been updated to reflect call
redirections performed at analysis stage which is the problem here and
which is (for reasons I have never quite grasped) done as a part of
inlining transformation phase.

OTOH, I am all for moving the call to execute_all_ipa_transforms()
from expand_function() to compile(), at least in trunk.


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

* [Bug middle-end/60937] -Os -fprofile-arcs breaks __attribute__((error()))
  2014-04-23 11:50 [Bug c/60937] New: -Os -fprofile-arcs breaks __attribute__((error())) kirill at shutemov dot name
@ 2021-12-05  9:08 ` pinskia at gcc dot gnu.org
  2021-12-09  9:23 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-05  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks to be fixed on the trunk.
Where we can jump thread:
  <bb 4> [local count: 1073741824]:
  # _26 = PHI <0(2), -12(3)>
  PROF_edge_counter_8 = __gcov0._Z16__get_user_pagesv[1];
  PROF_edge_counter_9 = PROF_edge_counter_8 + 1;
  __gcov0._Z16__get_user_pagesv[1] = PROF_edge_counter_9;
  switch (_26) <default: <L9> [33.00%], case -133: <L8> [67.00%], case -12:
<L8> [67.00%], case 0: <L8> [67.00%]>

Now. as the switch only will goto L8 for the two values of _26.

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

* [Bug middle-end/60937] -Os -fprofile-arcs breaks __attribute__((error()))
  2014-04-23 11:50 [Bug c/60937] New: -Os -fprofile-arcs breaks __attribute__((error())) kirill at shutemov dot name
  2021-12-05  9:08 ` [Bug middle-end/60937] " pinskia at gcc dot gnu.org
@ 2021-12-09  9:23 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-09  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|needs-bisection             |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-12-09
     Ever confirmed|0                           |1

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with r12-324-g69e5544210e3c0e2.

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

end of thread, other threads:[~2021-12-09  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 11:50 [Bug c/60937] New: -Os -fprofile-arcs breaks __attribute__((error())) kirill at shutemov dot name
2021-12-05  9:08 ` [Bug middle-end/60937] " pinskia at gcc dot gnu.org
2021-12-09  9:23 ` marxin 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).