From mboxrd@z Thu Jan 1 00:00:00 1970 From: peteb@sitera.com To: gcc-gnats@gcc.gnu.org Subject: c++/1833: inlining sometimes causes incorrect behavior Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010201192239.7990.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg00858.html List-Id: >Number: 1833 >Category: c++ >Synopsis: inlining sometimes causes incorrect behavior >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Feb 01 11:26:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Peter Bartlett >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: >Description: The attached program calls two versions of a function, one inlined and the other not. The inlined function does not behave correctly. The type casting of a (char *) argument to (const char *) as an argument to another funtion that takes (const char *&) does not properly modify the argument in the calling function in the inlined version. >How-To-Repeat: #include void frob2 (const char*& s) { s += 3; } inline void frob_fail (char *s) { frob2((const char *)s); cerr << "should be 34567: " << s << endl; } void frob_pass (char *s) { frob2((const char *)s); cerr << "should be 34567: " << s << endl; } int main (unsigned argc, const char *const argv[]) { char *x = "01234567"; frob_fail(x); char *y = "01234567"; frob_pass(y); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: >>From David.Billinghurst@riotinto.com Sun Apr 01 00:00:00 2001 From: "Billinghurst, David \(CRTS\)" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: re: c/1872 Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010205234601.11151.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg00983.html Content-length: 780 The following reply was made to PR c/1872; it has been noted by GNATS. From: "Billinghurst, David (CRTS)" To: "'gcc-gnats@gcc.gnu.org'" , "Billinghurst, David (CRTS)" , "'nobody@gcc.gnu.org'" Cc: Subject: re: c/1872 Date: Mon, 5 Feb 2001 23:38:32 -0000 This can be closed. Fixed by: Mon Feb 5 11:23:16 2001 Richard Kenner * config/mips/mips.c (override_options): Fix typo in last change. (mips_make_temp_file): Call fatal_io_error, not pfatal_with_name. (mips_asm_file_end): Likewise; also pass more args to fatal_io_error. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1872&database=gcc >>From neil@gcc.gnu.org Sun Apr 01 00:00:00 2001 From: neil@gcc.gnu.org To: egcs@cygnus.com Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/1688 Date: Sun, 01 Apr 2001 00:00:00 -0000 X-SW-Source: 2001-q1/msg02357.html Content-length: 0