From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25179 invoked by alias); 11 Apr 2013 18:05:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24812 invoked by uid 48); 11 Apr 2013 18:05:18 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/56905] [C++11][DR 1130] std::copy_exception should be removed or no longer be used Date: Thu, 11 Apr 2013 18:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg01002.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56905 --- Comment #2 from Daniel Kr=C3=BCgler 2013-04-11 18:05:18 UTC --- Here is my suggestion for a possible test, to be compiled with flags -std=3Dc++11 -Wall -W -pedantic //------------------------- #define copy_exception k42; #include #include //------------------------- This code should be accepted, but chokes currently (as expected). >>From gcc-bugs-return-419858-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 11 18:29:26 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 10589 invoked by alias); 11 Apr 2013 18:29:26 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 10446 invoked by uid 48); 11 Apr 2013 18:29:22 -0000 From: "josh.m.conner at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/56924] New: Folding of checks into a range check should check upper boundary Date: Thu, 11 Apr 2013 18:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: josh.m.conner at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg01003.txt.bz2 Content-length: 1600 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56924 Bug #: 56924 Summary: Folding of checks into a range check should check upper boundary Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: josh.m.conner@gmail.com When we are performing folding of checks into a range check, if the values are at the top-end of the range we should just use a > test instead of normalizing them into the bottom of the range and using a < test. For example, consider: struct stype { unsigned int pad:4; unsigned int val:4; }; void bar (void); void foo (struct stype input) { if ((input.val == 0xe) || (input.val == 0xf)) bar(); } When compiled at -O2, the original tree generated is: ;; Function foo (null) ;; enabled by -tree-original { if (input.val + 2 <= 1) { bar (); } } This is likely to be more efficient if we instead generate: if (input.val >= 0xe) { bar (); } This can be seen in the inefficient codegen for an ARM cortex-a15: ubfx r0, r0, #4, #4 add r3, r0, #2 and r3, r3, #15 cmp r3, #1 (the add and the and are not necessary if we change the test condition). I was able to improve this by adding detection of this case into build_range_check.