From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 366 invoked by alias); 19 Sep 2014 13:07:04 -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 309 invoked by uid 48); 19 Sep 2014 13:07:00 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58192] G++ emits incorrect code when passing enum classes as function parameters Date: Fri, 19 Sep 2014 13:07: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.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 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: 2014-09/txt/msg01929.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58192 --- Comment #9 from Uro=C5=A1 Bizjak --- Looking at dumps, obtained with -m32 -O1, we have following sequence before= the call to _ZN2S1Ut_3setE3Foo: _.dfinit: (insn 7 3 8 2 (parallel [ (set (reg:SI 88) (lshiftrt:SI (reg/v:SI 86 [ t ]) (const_int 16 [0x10]))) (clobber (reg:CC 17 flags)) ]) 539 {*lshrsi3_1} (nil)) (insn 8 7 9 2 (parallel [ (set (reg:QI 85 [ t$2 ]) (and:QI (subreg:QI (reg:SI 88) 0) (const_int -1 [0xffffffffffffffff]))) (clobber (reg:CC 17 flags)) ]) 379 {*andqi_1} (nil)) ... (insn 10 9 11 2 (set (reg:QI 1 dx) (reg:QI 85 [ t$2 ])) gcc-bug.cc:72 93 {*movqi_internal} (nil)) ... (call_insn 12 11 13 2 (call (mem:QI (symbol_ref:SI ("_ZN2S1Ut_3setE3Foo") [flags 0x3] ) [0 set S1 A8]) (const_int 0 [0])) gcc-bug.cc:72 651 {*call} (expr_list:REG_EH_REGION (const_int 0 [0]) (nil)) (expr_list:SI (use (reg:SI 0 ax)) (expr_list:QI (use (reg:QI 1 dx)) (nil)))) _.cse1 mangles argument setup to: (insn 8 7 9 2 (set (reg:QI 85 [ t$2 ]) (subreg:QI (reg:SI 88) 0)) 93 {*movqi_internal} (expr_list:REG_DEAD (reg:SI 88) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) ... (insn 10 9 11 2 (set (reg:QI 1 dx) (subreg:QI (reg:SI 88) 0)) gcc-bug.cc:72 93 {*movqi_internal} (nil)) and _.fwprop1 merges both to: (insn 10 9 11 2 (set (reg:QI 1 dx) (subreg:QI (reg:SI 88) 0)) gcc-bug.cc:72 93 {*movqi_internal} (nil)) resulting in: #(insn 10 9 34 2 (set (reg:QI 1 dx) # (reg:QI 3 bx [88])) gcc-bug.cc:72 93 {*movqi_internal} # (nil)) movl %ebx, %edx # 10 *movqi_internal/1 [length =3D 2] However, x86 ABI mandates that arguments should be properly extended in the call to the function. I don't think original (insn 8) is correct, as it is effectively a NOP. >>From gcc-bugs-return-462096-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 19 13:11:17 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 2073 invoked by alias); 19 Sep 2014 13:11:16 -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 2050 invoked by uid 48); 19 Sep 2014 13:11:10 -0000 From: "marcos.diaz at tallertechnologies dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/63301] inconsistency on wchar_t and wint_t types and sizes for diverse architectures Date: Fri, 19 Sep 2014 13:11: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.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marcos.diaz at tallertechnologies dot com X-Bugzilla-Status: RESOLVED 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg01930.txt.bz2 Content-length: 294 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63301 --- Comment #2 from Marcos Diaz --- Sorry, I expressed wrong the issue I was reporting, What I want to ask is the following: Is it ok that the wchar_t is a long int and the wint_t is just an int?