From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19149 invoked by alias); 24 Jun 2013 08:17:41 -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 19092 invoked by uid 48); 24 Jun 2013 08:17:36 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/57653] filename information discarded when using -imacros Date: Mon, 24 Jun 2013 08:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: WAITING 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01340.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57653 --- Comment #14 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Allan McRae from comment #13) > The file "/usr/include/stdc-predef.h" is from glibc (v2.17 on Arch) and is > specifically mentioned as being preincluded in > http://gcc.gnu.org/gcc-4.8/porting_to.html. In fact, using -ffreestanding > "solves" the issue. So when you use -ffreestanding, is stdc-predef.h still included?=20 You could put a break in push_command_line_include and check if -include fo= o.h still includes stdc-predef.h and whether it shows also the problem. If the = file is included but there is no bug, then my guess is that the code executed be= fore or after the pre-include stdc-predef.h is missing something for the -imacros case. If it shows the bug, then the code for pre-including stuff must be wr= ong somehow, perhaps cpp_push_default_include is doing something wrong when compared to cpp_push_include. >>From gcc-bugs-return-424962-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 24 08:18:30 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 20005 invoked by alias); 24 Jun 2013 08:18:30 -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 19971 invoked by uid 48); 24 Jun 2013 08:18:24 -0000 From: "lts-rudolph at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57695] New: [c++11] generalized attributes with avr __progmem__ Date: Mon, 24 Jun 2013 08:18: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-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lts-rudolph at gmx dot de 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: 2013-06/txt/msg01341.txt.bz2 Content-length: 1607 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57695 Bug ID: 57695 Summary: [c++11] generalized attributes with avr __progmem__ Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lts-rudolph at gmx dot de The two statements: extern const X x __attribute__ ((__progmem__)) = { 1 }; // works as expected extern const X x [[__progmem__]] = { 1 }; // warning & broken code See the following description to get working example. The following code compiles as expected with avr-g++ 4.8.1: (code must split in different translation units to see any result, because the optimizer will remove all effects while inlining the instructions) x.h: struct X { uint8_t a; }; x.cpp: extern const X x __attribute__ ((__progmem__)) = { 1 }; main.cpp: #include "x.h" extern const X x __attribute__ (( __progmem__ )); int main() { PORTB = pgm_read_byte(& (x.a)); return 0; } results in (objdump -d): 0000001a : 1a: 01 00 .. ... 2e: ea e1 ldi r30, 0x1A ; 26 30: f0 e0 ldi r31, 0x00 ; 0 32: c8 95 lpm the result is fine. Using generalized attributes do NOT work: extern const X x [[__progmem__]] = { 1 }; this results in a warning "x.cpp:8:32: warning: 'progmem' attribute directive ignored [-Wattributes]" and the code is broken because the var x is stored to ram instead of flash.