Debian Bug report logs - #325050
[PR 23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code

version graph

Package: gcc-4.0; Maintainer for gcc-4.0 is (unknown);

Reported by: "Kevin B. McCarty" <>

Date: Thu, 25 Aug 2005 19:48:02 UTC

Severity: normal

Tags: fixed-upstream, upstream

Found in version gcc-4.0/4.0.1-5

Fixed in version gcc-4.0/4.0.2-4

Done: Matthias Klose <>

Bug is archived. No further changes may be made.

Forwarded to

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to, Debian GCC Maintainers <>:
Bug#325050; Package gcc-4.0. Full text and rfc822 format available.

Acknowledgement sent to "Kevin B. McCarty" <>:
New Bug report received and forwarded. Copy sent to Debian GCC Maintainers <>. Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: "Kevin B. McCarty" <>
To: Debian Bug Tracking System <>
Subject: gcc-4.0: [4.0 regression] GCC 4.0 mis-compiles code leading to segfault
Date: Thu, 25 Aug 2005 19:32:43 +0000
[Message part 1 (text/plain, inline)]
Package: gcc-4.0
Version: 4.0.1-5
Severity: normal


Looking into Debian bug #324902, I found that it was due to an optimization
bug in GCC 4.0.  I isolated a test case which is attached as "test.c".  The
attached test.i and test.s files result from the command
	gcc-4.0 -Wall -pedantic -O1 -save-temps test.c
The command produces no warning output.

Compiling with gcc-4.0 -O0 or with gcc-3.4 at any optimization level
yields the expected output, "did we get here?".  Compiling with gcc-4.0
at -O1 or higher yields a segfault.  I have tested this only on i386.

To summarize, the problem appears to depend on a combination of two

- the char * and unsigned int variables being part of a struct
- the char * variable being assigned to with a character literal twice

The segfault happens because somehow the test "[s.len] != '\0'"
returns true (even though this doesn't make any sense), so an attempt is
made to change an element of the string literal.

Please let me know if you need any more information.  For what it's
worth this is quite an annoying bug because it breaks code typically
generated by cfortran (a header file acting as a C <-> FORTRAN bridge).

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-386
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages gcc-4.0 depends on:
ii  binutils                      2.16.1-2   The GNU assembler, linker and bina
ii  cpp-4.0                       4.0.1-5    The GNU C preprocessor
ii  gcc-4.0-base                  4.0.1-5    The GNU Compiler Collection (base 
ii  libc6                         2.3.5-4    GNU C Library: Shared libraries an
ii  libgcc1                       1:4.0.1-5  GCC support library

Versions of packages gcc-4.0 recommends:
ii  libc6-dev                     2.3.5-4    GNU C Library: Development Librari
pn  libmudflap0-dev               <none>     (no description available)

-- no debconf information


Kevin B. McCarty <>   Physics Department
WWW:    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544
[test.c (text/x-c, attachment)]
[test.i (text/x-c, attachment)]
[test.s (text/x-asm, attachment)]

Blocking bugs added: 325050 Request was from "Kevin B. McCarty" <kmccarty@Princeton.EDU> to Full text and rfc822 format available.

Information forwarded to, Debian GCC Maintainers <>:
Bug#325050; Package gcc-4.0. Full text and rfc822 format available.

Acknowledgement sent to Serge Belyshev <>:
Extra info received and forwarded to list. Copy sent to Debian GCC Maintainers <>. Full text and rfc822 format available.

Message #12 received at (full text, mbox):

From: Serge Belyshev <>
Subject: gcc-4.0: [4.0 regression] GCC 4.0 mis-compiles code leading to segfault
Date: Fri, 26 Aug 2005 01:57:22 +0400
tag 325050 upstream
forwarded 325050

Analysed and reported to upstream developers.

Noted your statement that Bug has been forwarded to Request was from Matthias Klose <> to Full text and rfc822 format available.

Changed Bug title. Request was from Matthias Klose <> to Full text and rfc822 format available.

Tags added: upstream Request was from Matthias Klose <> to Full text and rfc822 format available.

Information stored:
Bug#325050; Package gcc-4.0. Full text and rfc822 format available.

Acknowledgement sent to
Extra info received and filed, but not forwarded. Full text and rfc822 format available.

Message #23 received at (full text, mbox):

From: Matthias Klose <>
Subject: gcc: submitted Debian report #325050 to gcc-gnats as PR 23567
Date: Mon, 29 Aug 2005 11:38:38 +0200
# submitted Debian report #325050 to gcc-gnats as PR 23567

forwarded 325050
retitle 325050 [PR 23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code
tags 325050 + upstream

Tags added: pending Request was from Matthias Klose <> to Full text and rfc822 format available.

Reply sent to Matthias Klose <>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "Kevin B. McCarty" <>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #30 received at (full text, mbox):

From: Matthias Klose <>
Subject: Bug#325050: fixed in gcc-4.0 4.0.2-4
Date: Wed, 16 Nov 2005 10:32:18 -0800
Source: gcc-4.0
Source-Version: 4.0.2-4

We believe that the bug you reported is fixed in the latest version of
gcc-4.0, which is due to be installed in the Debian FTP archive:

  to pool/main/g/gcc-4.0/cpp-4.0-doc_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/cpp-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/fastjar_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/fixincludes_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/g++-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gcc-4.0-base_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gcc-4.0-doc_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/gcc-4.0-locales_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/gcc-4.0_4.0.2-4.diff.gz
  to pool/main/g/gcc-4.0/gcc-4.0_4.0.2-4.dsc
  to pool/main/g/gcc-4.0/gcc-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gcj-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gfortran-4.0-doc_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/gfortran-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gij-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gnat-4.0-doc_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/gnat-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/gobjc-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/lib64gcc1_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/lib64gfortran0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/lib64objc1_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/lib64stdc++6-4.0-dbg_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/lib64stdc++6_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libffi4-dev_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libffi4_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgcc1_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgcj-common_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/libgcj6-awt_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgcj6-common_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/libgcj6-dbg_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgcj6-dev_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgcj6-src_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/libgcj6_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgfortran0-dev_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgfortran0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libgnat-4.0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libmudflap0-dev_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libmudflap0_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libobjc1_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libstdc++6-4.0-dbg_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libstdc++6-4.0-dev_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libstdc++6-4.0-doc_4.0.2-4_all.deb
  to pool/main/g/gcc-4.0/libstdc++6-4.0-pic_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/libstdc++6_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/protoize_4.0.2-4_i386.deb
  to pool/main/g/gcc-4.0/treelang-4.0_4.0.2-4_i386.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Matthias Klose <> (supplier of updated gcc-4.0 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing

Hash: SHA1

Format: 1.7
Date: Sat, 12 Nov 2005 10:46:10 +0100
Source: gcc-4.0
Binary: gcc-4.0-base libstdc++6 lib32ffi4 lib32gcj6-dev libobjc1 libgcc1 libgcj6-dev libgcj6-awt gpc-2.1-4.0 gcc-4.0-nof libstdc++6-4.0-dev lib32stdc++6-4.0-dbg libgcc2 lib64gnat-4.0 lib32gcj6 gpc-2.1-4.0-doc protoize lib64gcj6 treelang-4.0 libgnat-4.0 libstdc++6-4.0-dbg gcc-4.0-doc lib64stdc++6 lib32gfortran0 libffi4 lib64gcj6-awt gfortran-4.0-doc g++-4.0 libgcj6-src lib64ffi4 gcj-4.0 lib32gcc1 lib64stdc++6-4.0-dbg libgfortran0 gobjc-4.0 lib64objc1 cpp-4.0 gcc-4.0-soft-float gcc-4.0 gfortran-4.0 gcc-4.0-locales lib32objc1 libffi4-dev libgcj6 gnat-4.0-doc libgfortran0-dev libgcj-common libgcj6-common libstdc++6-4.0-pic cpp-4.0-doc lib64gcc1 fastjar gcc-4.0-hppa64 gij-4.0 fixincludes libmudflap0-dev libstdc++6-4.0-doc lib32stdc++6 gnat-4.0 libmudflap0 lib32gcj6-dbg lib64gfortran0 libgcj6-dbg
Architecture: source i386 all
Version: 4.0.2-4
Distribution: unstable
Urgency: low
Maintainer: Debian GCC Maintainers <>
Changed-By: Matthias Klose <>
 cpp-4.0    - The GNU C preprocessor
 cpp-4.0-doc - Documentation for the GNU C preprocessor (cpp)
 fastjar    - Jar creation utility
 fixincludes - Fix non-ANSI header files
 g++-4.0    - The GNU C++ compiler
 gcc-4.0    - The GNU C compiler
 gcc-4.0-base - The GNU Compiler Collection (base package)
 gcc-4.0-doc - Documentation for the GNU compilers (gcc, gobjc, g++)
 gcc-4.0-locales - The GNU C compiler (native language support files)
 gcj-4.0    - The GNU compiler for Java(TM)
 gfortran-4.0 - The GNU Fortran 95 compiler
 gfortran-4.0-doc - Documentation for the GNU Fortran compiler (gfortran)
 gij-4.0    - The GNU Java bytecode interpreter
 gnat-4.0   - The GNU Ada compiler
 gnat-4.0-doc - Documentation for the GNU Ada compiler (gnat)
 gobjc-4.0  - The GNU Objective-C compiler
 lib64gcc1  - GCC support library (64bit)
 lib64gfortran0 - Runtime library for GNU Fortran applications (64bit)
 lib64objc1 - Runtime library for GNU Objective-C applications (64bit)
 lib64stdc++6 - The GNU Standard C++ Library v3 (64bit)
 lib64stdc++6-4.0-dbg - The GNU Standard C++ Library v3 (debugging files)
 libffi4    - Foreign Function Interface library runtime
 libffi4-dev - Foreign Function Interface library (development files)
 libgcc1    - GCC support library
 libgcj-common - Java runtime library (common files)
 libgcj6    - Java runtime library for use with gcj
 libgcj6-awt - AWT peer runtime libraries for use with gcj
 libgcj6-common - Java runtime library for use with gcj (jar files)
 libgcj6-dbg - Debugging symbols for libraries provided in libgcj6-dev
 libgcj6-dev - Java development headers and static library for use with gcj
 libgcj6-src - libgcj java sources for use in eclipse
 libgfortran0 - Runtime library for GNU Fortran applications
 libgfortran0-dev - GNU Fortran library development
 libgnat-4.0 - Runtime library for GNU Ada applications
 libmudflap0 - GCC mudflap shared support libraries
 libmudflap0-dev - GCC mudflap support libraries (development files)
 libobjc1   - Runtime library for GNU Objective-C applications
 libstdc++6 - The GNU Standard C++ Library v3
 libstdc++6-4.0-dbg - The GNU Standard C++ Library v3 (debugging files)
 libstdc++6-4.0-dev - The GNU Standard C++ Library v3 (development files)
 libstdc++6-4.0-doc - The GNU Standard C++ Library v3 (documentation files)
 libstdc++6-4.0-pic - The GNU Standard C++ Library v3 (shared library subset kit)
 protoize   - Create/remove ANSI prototypes from C code
 treelang-4.0 - The GNU Treelang compiler
Closes: 323133 325050 330857 333100 336114 336463
 gcc-4.0 (4.0.2-4) unstable; urgency=low
   * Configure libstdc++ using the default allocator. Background:
     libstdc++6 is currently configured to use the mt allocator based on
     discussions in April 2004 with upstream libstdc++ developers. This
     configuration turned out to be a mistake (memory leaks and the
     allocator is still buggy), other distributions did change back to the
     new allocator (the default one) in mid-2005 (FC in July 2005). The
     change does not have an effect on symbols exported from libstdc++, but
     it does have an effect on symbols exported by libraries which use
     containers (using an allocator) from the template headers.
     See Closes: #336114.
     Requires renaming/rebuild of packages, see thread starting at
   * libstdc++6: Tighten libstdc++ shlibs version to 4.0.2-4.
   * Update to SVN 20051111, taken from the gcc-4_0-branch.
     - Fix PR preprocessor/24202, segfault with #pragma once (closes: #330857).
     - Fix PR rtl-optimization/23567, wrong code in if-conversion.
       Closes: #325050.
     - Fix PR rtl-optimization/23585 (delay slots). Closes: #336463.
     - Fix PR c++/21123, ICE in cp_expr_size. Closes: #323133, #333100.
   * Build-depend on expect-tcl8.3 on all architectures.
   * libstdc++6-4.0-dev: Depend on the libc-dev package. Ubuntu #18885.
   * Add workaround to build ada on alpha-linux, enable ada on alpha-linux,
     build shared libgnat library on alpha-linux, don't use the pregenerated
     ada files anymore.
   * libjava-saxdriver-fix: Fix a problem in the Aelfred2 SAX parser.
   * Do not explicitely configure with --enable-java-gc=boehm, which is the
 961f9bafa7f1cd6c1cbc13a2fd95783e 3385 devel standard gcc-4.0_4.0.2-4.dsc
 f98a69ed4b2de4ed319c3e8ddeb0f485 787431 devel standard gcc-4.0_4.0.2-4.diff.gz
 785072b3d173ef67b45519734ff39d71 183296 doc optional cpp-4.0-doc_4.0.2-4_all.deb
 289840208944cb0fc13ddabac29545c3 3119276 libs optional libgcj6-common_4.0.2-4_all.deb
 4914f2acfa10b851b0cfec1ad00ceafb 1174 libs optional libgcj-common_4.0.2-4_all.deb
 790782cdfcd6e2ada4a228170ea33f34 6436210 libdevel optional libgcj6-src_4.0.2-4_all.deb
 8e2585146ef6ce85823853f66adc529f 6036618 doc optional libstdc++6-4.0-doc_4.0.2-4_all.deb
 6d62bd89a110f74b364345f7f1468537 105996 doc optional gfortran-4.0-doc_4.0.2-4_all.deb
 8671668013d7fa8861b91a3f5e8eb2ff 946284 doc optional gnat-4.0-doc_4.0.2-4_all.deb
 f0779ebecf6cc28315571d7c4e60ca77 1577200 doc optional gcc-4.0-doc_4.0.2-4_all.deb
 7b7948684c631057bc043ef5a31c8322 1018014 devel optional gcc-4.0-locales_4.0.2-4_all.deb
 0af2fc50cff5e0221df66b6414f4c166 178218 devel required gcc-4.0-base_4.0.2-4_i386.deb
 e7e6d50007ad0beb80ce1a656ef4c706 93124 libs required libgcc1_4.0.2-4_i386.deb
 c452229252e5ff08ff83df14f0a0d18f 98294 libs optional lib64gcc1_4.0.2-4_i386.deb
 3e181dbbfaf2f1137788fd890a291867 2043782 interpreters standard cpp-4.0_4.0.2-4_i386.deb
 b339a09f23199ed841cccd5b9293d491 27418 devel optional protoize_4.0.2-4_i386.deb
 9c2d5ef6c70bb7efc2cbd1aac73b6f98 79684 devel optional fixincludes_4.0.2-4_i386.deb
 b1732bfb74866a3af0f85099d7dd750a 154260 libs optional libmudflap0_4.0.2-4_i386.deb
 c2eb15aa9bf54e1abda277819b873ab5 95966 libdevel optional libmudflap0-dev_4.0.2-4_i386.deb
 4e47ca5ada31e9fa3059b5edf22e2eca 2138618 devel optional gobjc-4.0_4.0.2-4_i386.deb
 91515ddca28a15ae6bb76d7b387966c6 121320 libs optional libobjc1_4.0.2-4_i386.deb
 105f5ef7faf447702487f01b8c287d46 43942 libs optional lib64objc1_4.0.2-4_i386.deb
 2e525fb6ba6bc5612864d7dbd7334b74 27446 devel optional gij-4.0_4.0.2-4_i386.deb
 4d001aac38f244ae645ccfe670aadb07 5122204 libs optional libgcj6_4.0.2-4_i386.deb
 bb05323e78f4e3f201cb030e1aad3a51 225742 libs optional libgcj6-awt_4.0.2-4_i386.deb
 f45126346adb86ca8ec0b0abb8a22785 2472916 devel optional gcj-4.0_4.0.2-4_i386.deb
 460429a48a2d3a318fdb1c08c27b26f9 8116004 libdevel optional libgcj6-dev_4.0.2-4_i386.deb
 9ae0deef2817261d0a02c2e0f5cc74a4 7598474 libdevel extra libgcj6-dbg_4.0.2-4_i386.deb
 a99c9a7840370120c027fa0c464c5cd3 129546 devel optional fastjar_4.0.2-4_i386.deb
 55956a35462a6b136a305f1915627c14 93396 libs optional libffi4_4.0.2-4_i386.deb
 4a213ee00bf1ce4a17928ed3f02f6b44 8954 libdevel optional libffi4-dev_4.0.2-4_i386.deb
 6b7e094f89e8a55faff8e6644083751b 2333792 devel standard g++-4.0_4.0.2-4_i386.deb
 87db6bd9e56274365e89fbe89758ef1e 351362 libs required libstdc++6_4.0.2-4_i386.deb
 3da860b84fddbcbb775bc9ef5f72383b 360516 libs optional lib64stdc++6_4.0.2-4_i386.deb
 9d15dbc7fc42495d13cc1245036c6553 8588784 libdevel extra lib64stdc++6-4.0-dbg_4.0.2-4_i386.deb
 da17b26c3b2dd43e310c940c3d583fd9 1479202 libdevel standard libstdc++6-4.0-dev_4.0.2-4_i386.deb
 843e4e7e7d91d374e052170ee81fbdbf 902286 libdevel extra libstdc++6-4.0-pic_4.0.2-4_i386.deb
 a4c339efccfc72e2982c79aa9e859529 5696724 libdevel extra libstdc++6-4.0-dbg_4.0.2-4_i386.deb
 fa1f0c392cdae4d75262fb576a0f43de 112252 libs optional libgfortran0_4.0.2-4_i386.deb
 4dd72e794305b85a0f412569974f24b1 107796 libs optional lib64gfortran0_4.0.2-4_i386.deb
 aea03ba1d990481ba66342b7524c19f3 2145784 devel optional gfortran-4.0_4.0.2-4_i386.deb
 d7bf571699c9a105450578e2c9fc5f3a 277610 libdevel optional libgfortran0-dev_4.0.2-4_i386.deb
 f0810c57baa7f85eda53186ed57c1c2b 876234 libs optional libgnat-4.0_4.0.2-4_i386.deb
 8d0fb40e12131c5dfffb69548c220602 9844330 devel optional gnat-4.0_4.0.2-4_i386.deb
 b7f6b228863ac84ce850615708914d7b 1923944 devel optional treelang-4.0_4.0.2-4_i386.deb
 7b7d53428837ddb178f719317fa1f649 511452 devel standard gcc-4.0_4.0.2-4_i386.deb

Version: GnuPG v1.4.2 (GNU/Linux)


Tags added: fixed-upstream Request was from to Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <> to (Mon, 25 Jun 2007 13:43:37 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Wed Apr 16 04:21:35 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.