Summary: | [3.4/4.0 Regression] -fwritable strings triggers bad code generation | ||
---|---|---|---|
Product: | gcc | Reporter: | fnf |
Component: | c | Assignee: | Eric Botcazou <ebotcazou> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | Keywords: | patch, wrong-code |
Version: | 3.4.0 | ||
Target Milestone: | 3.4.0 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | 3.3 |
Known to fail: | Last reconfirmed: | 2004-01-19 19:37:26 |
Description
fnf
2003-10-28 22:10:41 UTC
I can confirm this on the mainline (20031028), I want to say it is related to deferring of writing globals. We might remove or oboslete -fwritable-strings for 3.4. Can we remove this option, please or do something with this bug. Investigating. Path here: <http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03268.html>. Subject: Bug 12818 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2004-01-30 14:16:44 Modified files: gcc : ChangeLog varasm.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: fwritable-strings-1.c Log message: PR c/12818 * varasm.c (const_hash_1) <STRING_CST>: Use the address to compute the hash value if flag_writable_strings. (compare_constant) <STRING_CST>: Compare the addresses if flag_writable_strings. (build_constant_desc): Do not copy the expression for a STRING_CST if flag_writable_strings. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2561&r2=2.2562 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.405&r2=1.406 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3442&r2=1.3443 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/fwritable-strings-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 Subject: Bug 12818 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: ebotcazou@gcc.gnu.org 2004-01-30 14:23:24 Modified files: gcc : ChangeLog varasm.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: fwritable-strings-1.c Log message: PR c/12818 * varasm.c (const_hash_1) <STRING_CST>: Use the address to compute the hash value if flag_writable_strings. (compare_constant) <STRING_CST>: Compare the addresses if flag_writable_strings. (build_constant_desc): Do not copy the expression for a STRING_CST if flag_writable_strings. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.111&r2=2.2326.2.112 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.405&r2=1.405.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.32&r2=1.3389.2.33 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/fwritable-strings-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 See the aforementioned patch. |