* [Bug middle-end/25120] [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
@ 2005-11-27 15:52 ` ghazi at gcc dot gnu dot org
2005-11-27 16:11 ` [Bug middle-end/25120] " pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-27 15:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ghazi at gcc dot gnu dot org 2005-11-27 15:52 -------
This is the same bug as PR 18785 and probably has a similar solution. I'm
working on a patch.
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ghazi at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-11-27 15:52:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin printf/fprintf is confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
2005-11-27 15:52 ` [Bug middle-end/25120] " ghazi at gcc dot gnu dot org
@ 2005-11-27 16:11 ` pinskia at gcc dot gnu dot org
2005-11-27 16:59 ` ghazi at gcc dot gnu dot org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-27 16:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-11-27 16:11 -------
Isn't a simular problem as PR 20110?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.4/4.0/4.1/4.2] builtin |builtin printf/fprintf is
|printf/fprintf is confused |confused by -fexec-charset
|by -fexec-charset |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin printf/fprintf is confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
2005-11-27 15:52 ` [Bug middle-end/25120] " ghazi at gcc dot gnu dot org
2005-11-27 16:11 ` [Bug middle-end/25120] " pinskia at gcc dot gnu dot org
@ 2005-11-27 16:59 ` ghazi at gcc dot gnu dot org
2005-11-27 17:01 ` [Bug middle-end/25120] builtin *printf handlers are " ghazi at gcc dot gnu dot org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-27 16:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ghazi at gcc dot gnu dot org 2005-11-27 16:59 -------
Yes same conceptual problem, but entirely different GCC location. This bug
lies in builtins.c and PR 20110 lies in c-format.c.
What I mean is that they be fixed separately and should not have any bugzilla
dependencies.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-11-27 16:59 ` ghazi at gcc dot gnu dot org
@ 2005-11-27 17:01 ` ghazi at gcc dot gnu dot org
2005-11-27 22:45 ` ghazi at gcc dot gnu dot org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-27 17:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from ghazi at gcc dot gnu dot org 2005-11-27 17:01 -------
builtin sprintf (and _chk friends) also have the problem, changed summary to
reflect that.
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|builtin printf/fprintf is |builtin *printf handlers are
|confused by -fexec-charset |confused by -fexec-charset
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-11-27 17:01 ` [Bug middle-end/25120] builtin *printf handlers are " ghazi at gcc dot gnu dot org
@ 2005-11-27 22:45 ` ghazi at gcc dot gnu dot org
2005-11-28 0:45 ` joseph at codesourcery dot com
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-27 22:45 UTC (permalink / raw)
To: gcc-bugs
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-11-27 22:45 ` ghazi at gcc dot gnu dot org
@ 2005-11-28 0:45 ` joseph at codesourcery dot com
2005-11-28 2:45 ` ghazi at gcc dot gnu dot org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: joseph at codesourcery dot com @ 2005-11-28 0:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from joseph at codesourcery dot com 2005-11-28 00:45 -------
Subject: Re: New: [3.4/4.0/4.1/4.2] builtin printf/fprintf
is confused by -fexec-charset
On Sun, 27 Nov 2005, ghazi at gcc dot gnu dot org wrote:
> With a program compiled with e.g. -O2 -fexec-charset=IBM1047, the builtin
> handlers for printf and fprintf get confused because they check for matching
> stuff in the format string like "%s", "%s\n", "%c" and trailing "\n" using the
> host's charset values. So they don't match correctly when compiling strings in
This looks the same as bug 20109 to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-11-28 0:45 ` joseph at codesourcery dot com
@ 2005-11-28 2:45 ` ghazi at gcc dot gnu dot org
2005-11-28 3:36 ` ghazi at gcc dot gnu dot org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-28 2:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ghazi at gcc dot gnu dot org 2005-11-28 02:45 -------
*** Bug 20109 has been marked as a duplicate of this bug. ***
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-11-28 2:45 ` ghazi at gcc dot gnu dot org
@ 2005-11-28 3:36 ` ghazi at gcc dot gnu dot org
2005-11-29 5:17 ` ghazi at gcc dot gnu dot org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-28 3:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ghazi at gcc dot gnu dot org 2005-11-28 03:36 -------
4.0 patch here:
http://gcc.gnu.org/ml/gcc-patches/2005-11/msg01918.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-11-28 3:36 ` ghazi at gcc dot gnu dot org
@ 2005-11-29 5:17 ` ghazi at gcc dot gnu dot org
2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-29 5:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from ghazi at gcc dot gnu dot org 2005-11-29 05:17 -------
Subject: Bug 25120
Author: ghazi
Date: Tue Nov 29 05:17:20 2005
New Revision: 107652
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107652
Log:
PR middle-end/20109
PR middle-end/25120
* builtins.c (init_target_chars): New.
(expand_builtin_printf, expand_builtin_fprintf,
expand_builtin_sprintf, fold_builtin_sprintf,
maybe_emit_sprintf_chk_warning, fold_builtin_sprintf_chk,
fold_builtin_snprintf_chk, fold_builtin_printf,
fold_builtin_fprintf): Check for matching format strings using
the target charset.
testsuite:
* gcc.dg/charset/builtin2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/charset/builtin2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-11-29 5:17 ` ghazi at gcc dot gnu dot org
@ 2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-29 5:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from ghazi at gcc dot gnu dot org 2005-11-29 05:18 -------
Subject: Bug 25120
Author: ghazi
Date: Tue Nov 29 05:18:13 2005
New Revision: 107654
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107654
Log:
PR middle-end/20109
PR middle-end/25120
* builtins.c (init_target_chars): New.
(expand_builtin_printf, expand_builtin_fprintf,
expand_builtin_sprintf, fold_builtin_sprintf): Check for matching
format strings using the target charset.
testsuite:
* gcc.dg/charset/builtin2.c: New test.
Added:
branches/gcc-4_0-branch/gcc/testsuite/gcc.dg/charset/builtin2.c
Modified:
branches/gcc-4_0-branch/gcc/ChangeLog
branches/gcc-4_0-branch/gcc/builtins.c
branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
@ 2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
2005-12-04 16:23 ` ghazi at gcc dot gnu dot org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-11-29 5:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from ghazi at gcc dot gnu dot org 2005-11-29 05:18 -------
Subject: Bug 25120
Author: ghazi
Date: Tue Nov 29 05:17:56 2005
New Revision: 107653
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107653
Log:
PR middle-end/20109
PR middle-end/25120
* builtins.c (init_target_chars): New.
(expand_builtin_printf, expand_builtin_fprintf,
expand_builtin_sprintf, fold_builtin_sprintf,
maybe_emit_sprintf_chk_warning, fold_builtin_sprintf_chk,
fold_builtin_snprintf_chk, fold_builtin_printf,
fold_builtin_fprintf): Check for matching format strings using
the target charset.
testsuite:
* gcc.dg/charset/builtin2.c: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/charset/builtin2.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/builtins.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-11-29 5:18 ` ghazi at gcc dot gnu dot org
@ 2005-12-04 16:23 ` ghazi at gcc dot gnu dot org
2005-12-04 17:07 ` gdr at integrable-solutions dot net
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-12-04 16:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from ghazi at gcc dot gnu dot org 2005-12-04 16:23 -------
Backporting this fix to 3.4 requires also backporting the infrastructure patch
for the lang hook to_target_charset posted here:
http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00780.html
We'd also need to backport the dg-require-iconv testsuite support, but that's
not hard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-12-04 16:23 ` ghazi at gcc dot gnu dot org
@ 2005-12-04 17:07 ` gdr at integrable-solutions dot net
2005-12-07 3:54 ` ghazi at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-12-04 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from gdr at integrable-solutions dot net 2005-12-04 17:07 -------
Subject: Re: builtin *printf handlers are confused by -fexec-charset
"ghazi at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Backporting this fix to 3.4 requires also backporting the infrastructure
patch
| for the lang hook to_target_charset posted here:
| http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00780.html
Hmm, I'm tempted to leave it is as wontix on 3.4.x. Thoughts?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-12-04 17:07 ` gdr at integrable-solutions dot net
@ 2005-12-07 3:54 ` ghazi at gcc dot gnu dot org
2006-02-05 21:40 ` pinskia at gcc dot gnu dot org
2006-09-16 16:32 ` kalium at gmx dot de
15 siblings, 0 replies; 17+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-12-07 3:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from ghazi at gcc dot gnu dot org 2005-12-07 03:54 -------
(In reply to comment #12)
> Subject: Re: builtin *printf handlers are confused by -fexec-charset
> "ghazi at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
> | Backporting this fix to 3.4 requires also backporting the infrastructure
> patch
> | for the lang hook to_target_charset posted here:
> | http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00780.html
> Hmm, I'm tempted to leave it is as wontix on 3.4.x. Thoughts?
> -- Gaby
I'm inclined to agree. I'm not familiar with the to_target_charset code enough
that I feel comfortable backporting it to a stable release series. If someone
else wants to tackle that, (Joseph?) then I'll backport the fix for this bug
and the testsuite iconv support. But I won't touch the charset stuff myself in
3.4.
--Kaveh
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (13 preceding siblings ...)
2005-12-07 3:54 ` ghazi at gcc dot gnu dot org
@ 2006-02-05 21:40 ` pinskia at gcc dot gnu dot org
2006-09-16 16:32 ` kalium at gmx dot de
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-05 21:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pinskia at gcc dot gnu dot org 2006-02-05 21:40 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/25120] builtin *printf handlers are confused by -fexec-charset
2005-11-27 15:50 [Bug middle-end/25120] New: [3.4/4.0/4.1/4.2] builtin printf/fprintf is confused by -fexec-charset ghazi at gcc dot gnu dot org
` (14 preceding siblings ...)
2006-02-05 21:40 ` pinskia at gcc dot gnu dot org
@ 2006-09-16 16:32 ` kalium at gmx dot de
15 siblings, 0 replies; 17+ messages in thread
From: kalium at gmx dot de @ 2006-09-16 16:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from kalium at gmx dot de 2006-09-16 16:32 -------
(In reply to comment #14)
> Fixed.
>
Where can I get fixes to gcc 3.4.6? (the branch is closed...)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25120
^ permalink raw reply [flat|nested] 17+ messages in thread