From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25510 invoked by alias); 5 Feb 2015 19:44:33 -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 25471 invoked by uid 48); 5 Feb 2015 19:44:28 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64953] Compiling sourcecode for STM32F103 causes USB errors with some optimization settings Date: Thu, 05 Feb 2015 19:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: trippels 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: cc Message-ID: In-Reply-To: References: 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: 2015-02/txt/msg00505.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64953 Markus Trippelsdorf changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |trippels at gcc dot gnu.org --- Comment #2 from Markus Trippelsdorf --- (In reply to manuel.reimer from comment #0) > After some trying I've found out that the key in this case is the > optimization setting. If I use "-O3", then the resulting binary works again > if I use the 4.9.2 compiler. > > So "something" is wrong with the optimization. > > Can someone give me a hint about what changed between 4.8 and 4.9.2? Is this > a bug in the gcc compiler or do I just need some new "compiler switch" to > disable "some new feature" and get a valid binary, again? Try to narrow the issue down to a single source file. Once you have found the file in question, you may narrow the problem down to a single function by using __attribute__((optimize("-Os"))). You could also try to build the application with -fsanitize=undefined and see if any issue pops up.