public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13696] [3.4] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
@ 2004-01-15 10:50 ` marcus at jet dot franken dot de
  2004-01-15 11:22 ` [Bug c++/13696] [3.4 Regression] " giovannibajo at libero dot it
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marcus at jet dot franken dot de @ 2004-01-15 10:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From marcus at jet dot franken dot de  2004-01-15 10:50 -------
Created an attachment (id=5495)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5495&action=view)
testcase for bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/13696] New: [3.4] enum not useable as array index?
@ 2004-01-15 10:50 marcus at jet dot franken dot de
  2004-01-15 10:50 ` [Bug c++/13696] " marcus at jet dot franken dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: marcus at jet dot franken dot de @ 2004-01-15 10:50 UTC (permalink / raw)
  To: gcc-bugs

Compiling the attached testcase with: 
g++ fl_color.ii 
gives: 
fl_color.ii:12: error: conversion from `struct s*' to `enum e' 
 
It should probably work, if I refactor it to: 
	unsigned long l = map[i][j].l; 
	x(&l); 
it works.

-- 
           Summary: [3.4] enum not useable as array index?
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marcus at jet dot franken dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
  2004-01-15 10:50 ` [Bug c++/13696] " marcus at jet dot franken dot de
@ 2004-01-15 11:22 ` giovannibajo at libero dot it
  2004-01-15 16:15 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-15 11:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-15 11:22 -------
Confirmed, a regression in mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-15 11:22:52
               date|                            |
            Summary|[3.4] enum not useable as   |[3.4 Regression] enum not
                   |array index?                |useable as array index?
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
  2004-01-15 10:50 ` [Bug c++/13696] " marcus at jet dot franken dot de
  2004-01-15 11:22 ` [Bug c++/13696] [3.4 Regression] " giovannibajo at libero dot it
@ 2004-01-15 16:15 ` pinskia at gcc dot gnu dot org
  2004-01-16 17:24 ` [Bug middle-end/13696] " mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-15 16:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-15 16:15 -------
>From Phil's regression hunter: Search converges between 2003-07-28-trunk (#356) and 2003-07
-29-trunk (#357).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (2 preceding siblings ...)
  2004-01-15 16:15 ` pinskia at gcc dot gnu dot org
@ 2004-01-16 17:24 ` mmitchel at gcc dot gnu dot org
  2004-01-26 15:03 ` [Bug middle-end/13696] [3.4/3.5 " roger at eyesopen dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-01-16 17:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-01-16 17:23 -------
This problem occurs because extract_muldiv_1 calls "convert" to try to convert a
pointer to an enum.

As I've said before, almost *any* use of "convert" by the middle-end is a bug.

The middle-end simply cannot know what kinds of conversions the front-end might
or might not do.

The back-end should explicitly generate NOP_EXPRs or CONVERT_EXPRs if it wants
to do conversions.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4/3.5 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (3 preceding siblings ...)
  2004-01-16 17:24 ` [Bug middle-end/13696] " mmitchel at gcc dot gnu dot org
@ 2004-01-26 15:03 ` roger at eyesopen dot com
  2004-02-06 21:19 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: roger at eyesopen dot com @ 2004-01-26 15:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger at eyesopen dot com  2004-01-26 15:03 -------
Patch at http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02694.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |roger at eyesopen dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4/3.5 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (4 preceding siblings ...)
  2004-01-26 15:03 ` [Bug middle-end/13696] [3.4/3.5 " roger at eyesopen dot com
@ 2004-02-06 21:19 ` pinskia at gcc dot gnu dot org
  2004-02-07  2:47 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06 21:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 21:19 -------
*** Bug 14051 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc at magfr dot user dot
                   |                            |lysator dot liu dot se


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4/3.5 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (5 preceding siblings ...)
  2004-02-06 21:19 ` pinskia at gcc dot gnu dot org
@ 2004-02-07  2:47 ` pinskia at gcc dot gnu dot org
  2004-02-07 18:57 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-07  2:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-07 02:47 -------
*** Bug 14057 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g_bugz at zewt dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4/3.5 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (6 preceding siblings ...)
  2004-02-07  2:47 ` pinskia at gcc dot gnu dot org
@ 2004-02-07 18:57 ` cvs-commit at gcc dot gnu dot org
  2004-02-07 19:02 ` [Bug middle-end/13696] [3.4 " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-07 18:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-07 18:57 -------
Subject: Bug 13696

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2004-02-07 18:57:35

Modified files:
	gcc            : ChangeLog fold-const.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: fold1.C 

Log message:
	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.
	
	* g++.dg/opt/fold1.C: New test case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2702&r2=2.2703
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.327&r2=1.328
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3476&r2=1.3477
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/fold1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (7 preceding siblings ...)
  2004-02-07 18:57 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-07 19:02 ` pinskia at gcc dot gnu dot org
  2004-02-16  5:15 ` cvs-commit at gcc dot gnu dot org
  2004-02-16  5:46 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-07 19:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-07 19:02 -------
Now not a 3.5.0 regression.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.4/3.5 Regression] enum   |[3.4 Regression] enum not
                   |not useable as array index? |useable as array index?


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (8 preceding siblings ...)
  2004-02-07 19:02 ` [Bug middle-end/13696] [3.4 " pinskia at gcc dot gnu dot org
@ 2004-02-16  5:15 ` cvs-commit at gcc dot gnu dot org
  2004-02-16  5:46 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ 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 13696

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=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug middle-end/13696] [3.4 Regression] enum not useable as array index?
  2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
                   ` (9 preceding siblings ...)
  2004-02-16  5:15 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-16  5:46 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-16  5:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-16 05:45 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13696


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-02-16  5:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-15 10:50 [Bug c++/13696] New: [3.4] enum not useable as array index? marcus at jet dot franken dot de
2004-01-15 10:50 ` [Bug c++/13696] " marcus at jet dot franken dot de
2004-01-15 11:22 ` [Bug c++/13696] [3.4 Regression] " giovannibajo at libero dot it
2004-01-15 16:15 ` pinskia at gcc dot gnu dot org
2004-01-16 17:24 ` [Bug middle-end/13696] " mmitchel at gcc dot gnu dot org
2004-01-26 15:03 ` [Bug middle-end/13696] [3.4/3.5 " roger at eyesopen dot com
2004-02-06 21:19 ` pinskia at gcc dot gnu dot org
2004-02-07  2:47 ` pinskia at gcc dot gnu dot org
2004-02-07 18:57 ` cvs-commit at gcc dot gnu dot org
2004-02-07 19:02 ` [Bug middle-end/13696] [3.4 " pinskia at gcc dot gnu dot org
2004-02-16  5:15 ` cvs-commit at gcc dot gnu dot org
2004-02-16  5:46 ` pinskia 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).