public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/14092] New: fold strips conversion from pointer to integer
@ 2004-02-10 9:26 bonzini at gnu dot org
2004-02-10 9:27 ` [Bug middle-end/14092] " bonzini at gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: bonzini at gnu dot org @ 2004-02-10 9:26 UTC (permalink / raw)
To: gcc-bugs
In the attached test case, fold invalidly changes this tree:
----
<negate_expr 0x402012e4
type <integer_type 0x401604a4 int SI
size <integer_cst 0x4015e21c constant 32>
unit size <integer_cst 0x4015e2a8 constant 4>
align 32 symtab 0 alias set -1 precision 32 min <integer_cst
0x4015e280 -2147483648> max <integer_cst 0x4015e294 2147483647>
pointer_to_this <pointer_type 0x40166ca8>>
arg 0 <nop_expr 0x402012a8 type <integer_type 0x401604a4 int>
arg 0 <plus_expr 0x40168300 type <pointer_type 0x4020206c>
arg 0 <nop_expr 0x4020126c type <pointer_type 0x4020206c>
arg 0 <non_lvalue_expr 0x4020121c type <pointer_type
0x401ffd80>
arg 0 <parm_decl 0x401ffdec plci>>>
arg 1 <integer_cst 0x40201258 constant 1>>>>
----
to this tree:
----
<minus_expr 0x40168318
type <pointer_type 0x4020206c
type <array_type 0x401ffbd0 type <integer_type 0x401602f4 unsigned
char>
QI
size <integer_cst 0x4015e8fc constant 8>
unit size <integer_cst 0x4015e7d0 constant 1>
align 8 symtab 0 alias set -1 domain <integer_type 0x4016a360>
pointer_to_this <pointer_type 0x4020206c>>
unsigned SI
size <integer_cst 0x4015e7e4 constant 32>
unit size <integer_cst 0x4015e834 constant 4>
align 32 symtab 0 alias set -1>
arg 0 <integer_cst 0x402012f8 type <pointer_type 0x4020206c> constant
4294967295>
arg 1 <nop_expr 0x4020126c type <pointer_type 0x4020206c>
arg 0 <non_lvalue_expr 0x4020121c type <pointer_type 0x401ffd80>
arg 0 <parm_decl 0x401ffdec plci>>>>
----
the type is wrong: the former is an integer, the latter is a pointer.
I'm CCing Roger because I suspect it is caused by his fold_convert changes
(did not try it though).
--
Summary: fold strips conversion from pointer to integer
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bonzini at gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,roger at eyesopen dot
com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
@ 2004-02-10 9:27 ` bonzini at gnu dot org
2004-02-10 9:31 ` bonzini at gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: bonzini at gnu dot org @ 2004-02-10 9:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bonzini at gnu dot org 2004-02-10 09:27 -------
Created an attachment (id=5715)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5715&action=view)
reduced testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
2004-02-10 9:27 ` [Bug middle-end/14092] " bonzini at gnu dot org
@ 2004-02-10 9:31 ` bonzini at gnu dot org
2004-02-10 11:31 ` [Bug middle-end/14092] [3.5 Regression] " pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: bonzini at gnu dot org @ 2004-02-10 9:31 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Keywords| |rejects-valid
Priority|P2 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] [3.5 Regression] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
2004-02-10 9:27 ` [Bug middle-end/14092] " bonzini at gnu dot org
2004-02-10 9:31 ` bonzini at gnu dot org
@ 2004-02-10 11:31 ` pinskia at gcc dot gnu dot org
2004-02-10 13:41 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-10 11:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-10 11:31 -------
Confirmed. Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00916.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |patch
Known to fail| |3.5.0
Known to work| |3.4.0
Last reconfirmed|0000-00-00 00:00:00 |2004-02-10 11:31:43
date| |
Summary|fold strips conversion from |[3.5 Regression] fold strips
|pointer to integer |conversion from pointer to
| |integer
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] [3.5 Regression] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
` (2 preceding siblings ...)
2004-02-10 11:31 ` [Bug middle-end/14092] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-02-10 13:41 ` cvs-commit at gcc dot gnu dot org
2004-02-10 15:52 ` pinskia at gcc dot gnu dot org
2004-02-16 5:15 ` cvs-commit at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-10 13:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-10 13:41 -------
Subject: Bug 14092
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bonzini@gcc.gnu.org 2004-02-10 13:41:17
Modified files:
gcc : ChangeLog fold-const.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: pr14092-1.c
Log message:
PR c/14092
* gcc.dg/pr14092-1.c: New testcase.
* fold-const.c (fold) <NEGATE_EXPR>: Convert result of
negate_expr back to the original type.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2730&r2=2.2731
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.329&r2=1.330
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3486&r2=1.3487
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr14092-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] [3.5 Regression] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
` (3 preceding siblings ...)
2004-02-10 13:41 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-10 15:52 ` pinskia at gcc dot gnu dot org
2004-02-16 5:15 ` cvs-commit at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-10 15:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-10 15:52 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/14092] [3.5 Regression] fold strips conversion from pointer to integer
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
` (4 preceding siblings ...)
2004-02-10 15:52 ` pinskia at gcc dot gnu dot org
@ 2004-02-16 5:15 ` cvs-commit at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-16 5:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-16 05:15 -------
Subject: Bug 14092
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: sayle@gcc.gnu.org 2004-02-16 05:15:20
Modified files:
gcc : ChangeLog fold-const.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/opt: fold1.C
gcc/testsuite/gcc.c-torture/compile: 20040209-1.c
gcc/testsuite/gcc.dg: pr14092-1.c
Log message:
Backport from mainline:
2004-02-07 Roger Sayle <roger@eyesopen.com>
PR middle-end/13696
* fold-const.c (fold_convert): New function to provide type
conversion to the middle-end without using convert.
(negate_expr, associate_trees, size_diffop, omit_one_operand,
operand_equal_for_comparison_p, pedantic_omit_one_operand,
invert_truthvalue, optimize_bit_field_compare, range_binop,
decode_field_reference, make_range, build_range_check, unextend,
fold_truthop, extract_muldiv_1, fold_mathfn_compare,
fold_binary_op_with_conditional_arg, fold_inf_compare,
fold_single_bit_test, fold, multiple_of_p): Replace all calls to
convert with calls to fold_convert.
2004-02-09 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold) <NOP_EXPR>: Use the original type conversion
tree code rather than call fold_convert, which doesn't specify a
default floating point to integer conversion.
2004-02-10 Paolo Bonzini <bonzini@gnu.org>
PR c/14092
* fold-const.c (fold) <NEGATE_EXPR>: Convert result of
negate_expr back to the original type.
2004-02-07 Roger Sayle <roger@eyesopen.com>
PR middle-end/13696
* g++.dg/opt/fold1.C: New test case.
2004-02-09 Roger Sayle <roger@eyesopen.com>
* gcc.c-torture/compile/20040209-1.c: New test case.
2004-02-10 Paolo Bonzini <bonzini@gnu.org>
PR c/14092
* gcc.dg/pr14092-1.c: New testcase.
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.199&r2=2.2326.2.200
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.322.2.3&r2=1.322.2.4
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.80&r2=1.3389.2.81
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/fold1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20040209-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr14092-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.4.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-02-16 5:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-10 9:26 [Bug middle-end/14092] New: fold strips conversion from pointer to integer bonzini at gnu dot org
2004-02-10 9:27 ` [Bug middle-end/14092] " bonzini at gnu dot org
2004-02-10 9:31 ` bonzini at gnu dot org
2004-02-10 11:31 ` [Bug middle-end/14092] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-10 13:41 ` cvs-commit at gcc dot gnu dot org
2004-02-10 15:52 ` pinskia at gcc dot gnu dot org
2004-02-16 5:15 ` cvs-commit at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).