This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/3325] cast of bit-field to same type gets discarded
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2004 08:44:44 -0000
- Subject: [Bug c/3325] cast of bit-field to same type gets discarded
- References: <20010621060602.3325.andreas.krakowczyk@fujitsu-siemens.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-08 08:44 -------
Subject: Bug 3325
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jsm28@gcc.gnu.org 2004-07-08 08:44:24
Modified files:
gcc : c-common.c c-decl.c c-lang.c expr.c
langhooks-def.h langhooks.h tree-ssa.c tree.c
tree.h
gcc/objc : objc-act.c objc-lang.c
gcc/testsuite : ChangeLog
gcc/testsuite/gcc.dg: bitfld-2.c
Added files:
gcc/testsuite/gcc.c-torture/execute: bitfld-3.c
Removed files:
gcc/testsuite/gcc.c-torture/execute: bitfld-1.x
Log message:
2004-07-08 Joseph S. Myers <jsm@polyomino.org.uk>
Neil Booth <neil@daikokuya.co.uk>
PR c/2511
PR c/3325
* c-decl.c (finish_struct): Ensure bit-fields are given the
correct type.
* c-common.c (c_common_signed_or_unsigned_type): For C, require
the precision to match as well as the mode.
* expr.c (reduce_to_bit_field_precision): New function.
(expand_expr_real_1): Reduce expressions of bit-field type to
proper precision.
* langhooks.h (reduce_bit_field_operations): New hook.
* langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS):
Define.
* c-lang.c, objc/objc-lang.c
(LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
* objc/objc-act.c (check_ivars): Convert types to bit-field types
before checking.
* tree.c (build_nonstandard_integer_type): New function.
* tree.h (build_nonstandard_integer_type): New prototype.
* tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't treat
conversions between integer and boolean types as useless.
testsuite:
* gcc.c-torture/execute/bitfld-1.x: Remove.
* gcc.c-torture/execute/bitfld-3.c: New test.
* gcc.dg/bitfld-2.c: Remove XFAILs.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.527&r2=1.528
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.528&r2=1.529
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-lang.c.diff?cvsroot=gcc&r1=1.129&r2=1.130
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&r1=1.673&r2=1.674
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks-def.h.diff?cvsroot=gcc&r1=1.83&r2=1.84
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.h.diff?cvsroot=gcc&r1=1.89&r2=1.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&r1=2.19&r2=2.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.391&r2=1.392
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.546&r2=1.547
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-act.c.diff?cvsroot=gcc&r1=1.229&r2=1.230
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-lang.c.diff?cvsroot=gcc&r1=1.47&r2=1.48
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3950&r2=1.3951
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/bitfld-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/bitfld-1.x.diff?cvsroot=gcc&r1=1.1&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/bitfld-2.c.diff?cvsroot=gcc&r1=1.2&r2=1.3
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3325