From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21344 invoked by alias); 12 Jan 2014 23:33:52 -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 21309 invoked by uid 48); 12 Jan 2014 23:33:49 -0000 From: "michael at talosis dot ca" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/59782] New: libcpp does not avoid bug #48326 when compiled by older GCC Date: Sun, 12 Jan 2014 23:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: michael at talosis dot ca 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: 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-01/txt/msg01306.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59782 Bug ID: 59782 Summary: libcpp does not avoid bug #48326 when compiled by older GCC Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: michael at talosis dot ca GCC 4.7.0 and other older versions have a bug (#48326) where the target attribute can leak, causing illegal instructions to be emitted in code intended to be generic. GCC 4.6.0 through 4.8.2 also contain code that triggers this bug, in libcpp/lex.c. That file uses the target attribute to opportunistically use MMX/SSE even in a generic binary. The result is that bootstrap is blocked if starting from 4.7.0 when the actual CPU does not support the new instructions. Currently the problem block of code is preprocessed in if GCC 4.5.0 or later is detected. It should instead only be used for 4.7.1 or later. Note that it is somewhat important to also fix this in 4.7.4. This bug only bites when upgrading from an old GCC. If someone has an old GCC with C++ not installed, then they cannot move directly to 4.8.x, and will have to build 4.7.x as an intermediate.