Summary: | [4.3 Regression] Canonical types failures | ||
---|---|---|---|
Product: | gcc | Reporter: | Wolfgang Bangerth <bangerth> |
Component: | c++ | Assignee: | dgregor |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | bangerth, dgregor, fang, gcc-bugs, pinskia |
Priority: | P3 | ||
Version: | 4.3.0 | ||
Target Milestone: | 4.3.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2007-04-09 10:39:33 |
Description
Wolfgang Bangerth
2007-04-07 16:53:10 UTC
*** Bug 31506 has been marked as a duplicate of this bug. *** For some reason, bugzilla gives me an internal error when I try to attach the file. In any case, it is here: http://www.math.tamu.edu/~bangerth/step-27.ii.gz Reducing. I bet a beer that this is related to code like: int a[] = {1,2}; The only reason I am saying that is because the last time I looked into a failure of giving the same aliasing set to int[] = {1,2} as int[2] was the same problem. Reduced testcase (which makes I am correct): template <int dim> struct Point { Point (const double x, const double y); }; Point<2> f(void) {} void create_coarse_grid () { static const Point<2> vertices_1[] = { Point<2> (-1., -1.), Point<2> (-1./2, -1.), Point<2> (0., -1.), Point<2> (+1./2, -1.) }; } ===================== If I change [] to [4] then it works. This is clearly my bug, but I am not able to reproduce it on i686-pc-linux-gnu. Does the following patch fix the problem? http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00188.html If not, which platform are you seeing the problem on? (In reply to comment #6) > This is clearly my bug, but I am not able to reproduce it on i686-pc-linux-gnu. This was with r123617, on i686-pc-linux-gnu. I can reproduce with this version and Andrew's testcase, though only with -O2. Did you try it with this flag? W. (In reply to comment #6) > Does the following patch fix the problem? > > http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00188.html Yes. I think it would be good if you added Andrew's testcase to the patch as well, compiled with -O2. W. I can't reproduce this bug with r123671 on i686-pc-linux-gnu. However, since the above patch does fix the problem, I'll add this PR to the ChangeLog for that patch. Great, thanks. Hopefully someone approves the patch soon. Talking about canonical types: I think the idea of only issuing a warning in cases like the current one is a really bad idea. Warnings are meant for things where the programmer did something dubious (if correct) and that can be silenced by adjusting the source code. On the other hand, what we have here is a compiler whose internal data structures have become corrupted. That's pretty much the definition of what we use ICEs for, and I would urge you to reconsider the idea of using a warning instead. Does it matter? I do think so. For example, I found this one by actually looking at the log files of my automated compile jobs. It showed a successful compilation, rather than a failure, because a warning still makes 'make' go on as if nothing had happened. I'm sure canonical type failures would be found quicker if their effect was more drastic, because it makes people look for the place where something goes wrong. Best Wolfgang Subject: Re: [4.3 Regression] Canonical types failures "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes: | Talking about canonical types: I think the idea of only issuing a warning | in cases like the current one is a really bad idea. Fully agreed. I believe we discussed this on the main list. It should not be a warning. It should be an ICE. This is a compiler bug. That is what ICE is for. -- Gaby Yay to making it an ICE instead of a warning. Same problem/cause as 31103, which is now fixed on mainline. *** This bug has been marked as a duplicate of 31103 *** |