Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 28755
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Jakub Jelinek <jakub@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: David Woodhouse <dwmw2@infradead.org>
Add CC:
CC:
Remove selected CCs
Build:
Patch URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
pr28755.tar.gz test case application/octet-stream 2006-08-16 17:29 517 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 28755 depends on: Show dependency tree
Show dependency graph
Bug 28755 blocks: 28779

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2007-08-06 14:43 Opened: 2006-08-16 17:28
See attached test case. Observe the number of times certain lines of the
'vesa_modes' array are emitted. This isn't particularly optimal, especially as
it happens even with -Os.

 $ make
cc -Os -c -o fbmon.o fbmon.i -save-temps
grep 39682 fbmon.s
        .long   39682
        .long   39682

------- Comment #1 From David Woodhouse 2006-08-16 17:29 -------
Created an attachment (id=12084) [edit]
test case

------- Comment #2 From Andrew Pinski 2006-08-16 17:36 -------
This is an expand/middle-end issue as get:
  *mode = vesa_modes[0];
in the final_cleanup.

------- Comment #3 From Andrew Pinski 2006-08-16 17:37 -------
Confirmed, here is the testcase for lazy people (like me) who really don't want
to download the tar file:
struct fb_videomode {
 const char *name;
 unsigned refresh;
 unsigned xres;
 unsigned yres;
 unsigned pixclock;
 unsigned left_margin;
 unsigned right_margin;
 unsigned upper_margin;
 unsigned lower_margin;
 unsigned hsync_len;
 unsigned vsync_len;
 unsigned sync;
 unsigned vmode;
 unsigned flag;
};

const struct fb_videomode vesa_modes[] = {

 { ((void *)0), 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
   0, 0, 4 },
};

void get_est_timing(unsigned char *block, struct fb_videomode *mode)
{
        mode[0] = vesa_modes[0];
}
-------
Oh this is not a regression as far as I can tell.

------- Comment #4 From Andrew Pinski 2006-08-16 17:39 -------
Actually it is a regression from 2.95.3, I just had to go back in time enough
to get find that.

------- Comment #5 From patchapp@dberlin.org 2006-08-21 04:29 -------
Subject: Bug number PR middle-end/28755

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00601.html

------- Comment #6 From Gabriel Dos Reis 2007-02-03 18:56 -------
Won't fix in GCC-4.0.x.  Adjusting milestone.

------- Comment #7 From Jakub Jelinek 2007-09-23 09:34 -------
Subject: Bug 28755

Author: jakub
Date: Sun Sep 23 09:34:28 2007
New Revision: 128685

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128685
Log:
        PR middle-end/28755
        * expr.c (expand_constructor): New function.
        (expand_expr_real_1) <case CONSTRUCTOR>: Call it.
        (expand_expr_real_1) <case ARRAY_REF>: Call it if VALUE is
        CONSTRUCTOR.

        * gcc.dg/pr28755.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr28755.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/expr.c
    trunk/gcc/testsuite/ChangeLog

------- Comment #8 From Jakub Jelinek 2007-09-24 06:36 -------
Fixed on the trunk.

------- Comment #9 From Alexandre Pereira Nunes 2008-01-15 18:12 -------
(In reply to comment #8)
> Fixed on the trunk.
> 

For anyone else wondering, this is still reproductible on vanilla gcc 4.2.2.

------- Comment #10 From Joseph S. Myers 2008-07-04 21:27 -------
Closing 4.1 branch.

------- Comment #11 From Joseph S. Myers 2009-03-30 17:03 -------
Closing 4.2 branch, fixed in 4.3.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug