public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr
@ 2011-08-12 14:49 paolo.carlini at oracle dot com
2011-08-12 14:51 ` [Bug c++/50059] " paolo.carlini at oracle dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-12 14:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
Bug #: 50059
Summary: [C++0x] Broken error message with __builtin_remquo &
constexpr
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: paolo.carlini@oracle.com
Consider this:
int r = 0;
constexpr double d = __builtin_remquo(1, 1, &r);
The error message is:
a.cc:2:49: error: expression ‘(r <unknown operator> 1)’ is not a
constant-expression
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
@ 2011-08-12 14:51 ` paolo.carlini at oracle dot com
2011-08-12 15:11 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-12 14:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-12 14:49:27 UTC ---
__builtin_modf has similar problems
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
2011-08-12 14:51 ` [Bug c++/50059] " paolo.carlini at oracle dot com
@ 2011-08-12 15:11 ` paolo.carlini at oracle dot com
2011-08-12 16:26 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-12 15:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-08-12
CC| |jason at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-12 15:06:49 UTC ---
Happens also with <cmath> and std::remquo, std::modf, CC-ing Jason.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
2011-08-12 14:51 ` [Bug c++/50059] " paolo.carlini at oracle dot com
2011-08-12 15:11 ` paolo.carlini at oracle dot com
@ 2011-08-12 16:26 ` paolo.carlini at oracle dot com
2011-08-12 18:08 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-12 16:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-12 16:21:08 UTC ---
... and __builtin_frexp (std::frexp)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
` (2 preceding siblings ...)
2011-08-12 16:26 ` paolo.carlini at oracle dot com
@ 2011-08-12 18:08 ` paolo.carlini at oracle dot com
2011-08-13 20:14 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-12 18:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-12 18:01:43 UTC ---
And I suspect that this diagnostic issue may be not unrelated to what I was
noticing today together with PR50060: these badly printed intrinsics (remquo,
modf, frexp) can be optimized by the middle-end but aren't really viable as
constexpr functions because of the pointer parameter. Thus, by the time error.c
is involved the middle-end has computed the constants and erased any info about
the name of the intrinsics. Can be?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
` (3 preceding siblings ...)
2011-08-12 18:08 ` paolo.carlini at oracle dot com
@ 2011-08-13 20:14 ` jason at gcc dot gnu.org
2011-08-13 20:50 ` jason at gcc dot gnu.org
2011-08-13 21:36 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-13 20:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-13 20:03:26 UTC ---
Author: jason
Date: Sat Aug 13 20:03:23 2011
New Revision: 177735
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177735
Log:
PR c++/50059
* error.c (dump_expr): Handle MODIFY_EXPR properly.
Added:
trunk/gcc/testsuite/g++.dg/diagnostic/expr1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
` (4 preceding siblings ...)
2011-08-13 20:14 ` jason at gcc dot gnu.org
@ 2011-08-13 20:50 ` jason at gcc dot gnu.org
2011-08-13 21:36 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-13 20:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
AssignedTo|unassigned at gcc dot |jason at redhat dot com
|gnu.org |
Target Milestone|--- |4.7.0
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-13 20:13:40 UTC ---
Fixed to print (r = 0) instead. Anything further would need to change the
front end to delay folding like the C front end does.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50059] [C++0x] Broken error message with __builtin_remquo & constexpr
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
` (5 preceding siblings ...)
2011-08-13 20:50 ` jason at gcc dot gnu.org
@ 2011-08-13 21:36 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-13 21:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50059
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-13 21:33:52 UTC ---
Ah, thanks also for the clarification. Anyway, at least now the error message
makes clear why *exactly* the functions isn't viable as constexpr.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-08-13 21:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-12 14:49 [Bug c++/50059] New: [C++0x] Broken error message with __builtin_remquo & constexpr paolo.carlini at oracle dot com
2011-08-12 14:51 ` [Bug c++/50059] " paolo.carlini at oracle dot com
2011-08-12 15:11 ` paolo.carlini at oracle dot com
2011-08-12 16:26 ` paolo.carlini at oracle dot com
2011-08-12 18:08 ` paolo.carlini at oracle dot com
2011-08-13 20:14 ` jason at gcc dot gnu.org
2011-08-13 20:50 ` jason at gcc dot gnu.org
2011-08-13 21:36 ` paolo.carlini at oracle dot com
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).