I had to pluck some code out of c-family/c-ubsan.c
(otherwise we couldn't call ubsan_* routines from builtins.c), I've put
the code into ubsan.c.
Commited to ubsan branch. Comments?
(I think I'm going to solve the ubsan testsuite now.)
2013-07-14 Marek Polacek pola...@redhat.com
On Sun, Jul 14, 2013 at 07:39:38AM +0200, Marek Polacek wrote:
This patch implements sanitizing of the __builtin_unreachable call.
A call to __builtin_unreachable only emits BARRIER, if we actually get to it,
the behavior is undefined. So, we just replace the call with a call to
the ubsan
On Sun, Jul 14, 2013 at 03:44:40PM +0200, Jakub Jelinek wrote:
On Sun, Jul 14, 2013 at 07:39:38AM +0200, Marek Polacek wrote:
This patch implements sanitizing of the __builtin_unreachable call.
A call to __builtin_unreachable only emits BARRIER, if we actually get to
it,
the behavior
On Mon, Jul 15, 2013 at 09:15:27AM +0800, JonY wrote:
On 7/15/2013 06:02, Kai Tietz wrote:
2013/7/13 JonY 10wa...@gmail.com:
On 7/10/2013 20:43, JonY wrote:
Hi,
Attached are some minor patches, comments?
Kai, ping?
Please sent each patch as separate mail, and please add
Some libubsan functions aren't really noreturn, so don't mark them as
such. This prevents failures with -O1+, since we don't generate any
code after calling noreturn routines, thus segfault when we actually
get there.
Applying to ubsan branch.
2013-07-15 Marek Polacek pola...@redhat.com
testsuite they
don't check much more. Maybe we should test also stuff like ++a (v * x)
etc.?
Tested with
make check RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} ubsan.exp'
Any comments before I put this on ubsan branch?
2013-07-15 Marek Polacek pola...@redhat.com
* gcc.c
This adds more testing to the ubsan testsuite. It still doesn't
test everything, but it's better than nothing and I've already found
one bug (already fixed).
Tested with RUNTESTFLAGS='--target_board=unix\{-m32,-m64\}.
Commited to ubsan branch.
2013-07-22 Marek Polacek pola...@redhat.com
I don't think there's a reason to include gimple.h twice...
Regtested/bootstrapped on x86_64-linux, will commit as obvious soon.
2013-07-22 Marek Polacek pola...@redhat.com
* gimplify.c: Don't include gimple.h twice.
--- gcc/gimplify.c.mp 2013-07-22 15:29:17.202468003 +0200
+++ gcc
On Mon, Jul 22, 2013 at 11:39:38AM -0500, pcha...@cs.wisc.edu wrote:
Hi,
The problem appears in revision 201034 in version 4.9. I attached
one-line patches that fixes it. I also reported this problem
at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57811
Bootstrap and regression-tested on
On Mon, Jul 22, 2013 at 10:09:00AM -0400, Jason Merrill wrote:
On 07/19/2013 02:45 PM, Marek Polacek wrote:
/* This type represents an entry in the hash table. */
struct ubsan_typedesc
{
+ /* This represents the type of a variable. */
tree type;
+
+ /* This is the VAR_DECL
On Tue, Jul 23, 2013 at 11:32:39AM +0200, Nicklas Bo Jensen wrote:
Hi,
Found a typo in the GCC Internals documentation in one of the code
examples in 16.18.2 RTL to RTL Peephole Optimizers.
Thanks, looks good, though the ChangeLog entry is missing, so
something like:
2013-07-23 Nicklas Bo
gcc/testsuite/ChangeLog.ubsan
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7eb40f1..32f46ec 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,120 +1,3 @@
-2013-07-24 Marek Polacek pola...@redhat.com
-
- * ubsan.c (struct ubsan_typedesc): Improve comment.
-
-2013-07-21 Marek Polacek
Hi!
I'd like to announce first version of the Undefined Behavior
Sanitizer, a tool I've spent this June/July hacking on.
It is an undefined behavior detector for the C family FEs
and works by creating a COMPOUND_EXPR around original expression,
for slightly more information see my slides about
On Thu, Jul 25, 2013 at 01:21:27PM -0400, David Malcolm wrote:
Successfully bootstrapped on x86_64-unknown-linux-gnu
OK for trunk?
commit 4d7b6e5cf8e7f2613f516c9b9fe1f888b1193f8d
Author: David Malcolm dmalc...@redhat.com
Date: Tue Jul 23 16:11:14 2013 -0400
Add missing deps to
On Thu, Jul 25, 2013 at 04:13:29PM -0400, Jason Merrill wrote:
On 07/25/2013 11:32 AM, Marek Polacek wrote:
+ vec_alloc (v, 3);
+ tree ctor = build_constructor (dtype, v);
You might use build_constructor_va instead of managing a vector directly.
Thanks, will give it a try.
Otherwise
On Thu, Jul 25, 2013 at 10:33:46PM -0700, Andrew Pinski wrote:
What does it mean by unsigned-integer-overflow? Unsigned integers
never overflow.
Or maybe I misread the documentation here.
Well, clang can sanitize even when unsigned int wraps. But this
feature seems doubtful, I don't think I
On Thu, Jul 25, 2013 at 10:50:14PM -0600, Jeff Law wrote:
On 07/25/2013 04:40 PM, Joseph S. Myers wrote:
On Thu, 25 Jul 2013, Marek Polacek wrote:
So far it sanitizes division-by-zeros, shifts and
__builtin_unreachable calls. This is of course far from being
complete; I intend to write
+1,8 @@
+2013-07-29 Marek Polacek pola...@redhat.com
+
+ * common.opt (static-libubsan): New option.
+ * doc/invoke.texi: Document -static-libubsan.
+
2013-07-24 Marek Polacek pola...@redhat.com
* ubsan.c (struct ubsan_typedesc): Improve comment.
diff --git a/gcc
Marek Polacek pola...@redhat.com
+
+ * c-typeck.c (build_binary_op): Sanitize only when
+ current_function_decl is not zero.
+
2013-07-21 Marek Polacek pola...@redhat.com
* c-typeck.c (build_binary_op): Call c_fully_fold on both
diff --git a/gcc/c/c-typeck.c b/gcc/c/c
/null
+++ b/config/ChangeLog.ubsan
@@ -0,0 +1,3 @@
+2013-07-30 Marek Polacek pola...@redhat.com
+
+ * bootstrap-ubsan.mk: New.
diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk
new file mode 100644
index 000..10543f6
--- /dev/null
+++ b/config/bootstrap-ubsan.mk
@@ -0,0
/ChangeLog.ubsan
+++ b/gcc/ChangeLog.ubsan
@@ -1,3 +1,9 @@
+2013-07-30 Marek Polacek pola...@redhat.com
+
+ * ubsan.c (ubsan_source_location): Use build_constructor_va
+ instead of build_constructor.
+ (ubsan_type_descriptor): Likewise.
+
2013-07-29 Marek Polacek pola
/gcc/ChangeLog.ubsan
@@ -1,5 +1,10 @@
2013-07-30 Marek Polacek pola...@redhat.com
+ * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Use flag_sanitize
+ instead of flag_asan.
+
+2013-07-30 Marek Polacek pola...@redhat.com
+
* ubsan.c (ubsan_source_location): Use
On Tue, Jul 30, 2013 at 04:34:14PM +0200, Marek Polacek wrote:
This adds the bootstrap-ubsan.mk file so that
--with-build-config=bootstrap-ubsan be possible. I doesn't work yet,
though :(.
One of the reasons is that we use -Werror and e.g. on the following
testcase
static int x;
void
foo
-unknown-linux-gnu, applying to ubsan branch.
diff --git a/gcc/c/ChangeLog.ubsan b/gcc/c/ChangeLog.ubsan
index 11d167f..f41ae90 100644
--- a/gcc/c/ChangeLog.ubsan
+++ b/gcc/c/ChangeLog.ubsan
@@ -1,3 +1,8 @@
+2013-07-31 Marek Polacek pola...@redhat.com
+
+ * c-typeck.c (build_binary_op): Sanitize
On Thu, Jul 25, 2013 at 10:40:22PM +, Joseph S. Myers wrote:
What happens if you bootstrap with this enabled - do whatever failures
appear look like genuine bugs? Running the testsuite with a compiler
built with this option? Running the testsuite with this option used when
compiling
This patch hopefully improves the documentation of the option in
question.
Applying to ubsan branch.
diff --git a/gcc/ChangeLog.ubsan b/gcc/ChangeLog.ubsan
index ac584ff..d7932c5 100644
--- a/gcc/ChangeLog.ubsan
+++ b/gcc/ChangeLog.ubsan
@@ -1,3 +1,7 @@
+2013-07-31 Marek Polacek pola
On Thu, Jul 25, 2013 at 10:43:30PM +, Joseph S. Myers wrote:
On Thu, 25 Jul 2013, Marek Polacek wrote:
+@item -fsanitize=undefined
+Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector
+Various computations will be instrumented to detect
+undefined behavior, e.g
/ChangeLog.ubsan
@@ -1,3 +1,7 @@
+2013-07-31 Marek Polacek pola...@redhat.com
+
+ * g++.dg/dg.exp: Add missing ubsan tests.
+
2013-07-30 Marek Polacek pola...@redhat.com
* c-c++-common/ubsan/const-expr.c: New test.
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
On Thu, Jul 25, 2013 at 04:13:29PM -0400, Jason Merrill wrote:
Otherwise, looks fine. If nobody else has comments, go ahead and
check it in next week.
I had to make a few changes since, particularly:
- [ubsan] Add -static-libubsan
http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01467.html
-
On Wed, Jul 31, 2013 at 02:52:39PM -0400, Jason Merrill wrote:
On 07/31/2013 01:33 PM, Marek Polacek wrote:
There are still at least two issues though, which is why
bootstrap with -fsanitize=undefined fails:
http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01480.html
This looks like a serious
On Sun, Aug 04, 2013 at 06:55:13PM +0200, Gerald Pfeifer wrote:
On Fri, 5 Jul 2013, Marek Polacek wrote:
I've created a new branch, called ubsan for work being done for
Undefined Behavior Sanitizer.
Mind documenting this in http://gcc.gnu.org/svn.html? Let me
know if you need help
-value warning),
but that didn't seem to be necessary...
Does that look up to snuff to you? Thanks,
2013-08-05 Marek Polacek pola...@redhat.com
* c-ubsan.c (ubsan_instrument_shift): Properly evaluate
SAVE_EXPR even in the C89 mode.
* gcc.dg/ubsan/save-expr-1.c: New test
I was creating the const char type in a wrong way. I should've used
build_qualified_type, otherwise we'd ICE in the C++ FE later on due to
mismatched TYPE_CANONICALs...
Tested x86_64-pc-linux-gnu, applying to ubsan branch.
2013-08-05 Marek Polacek pola...@redhat.com
* ubsan.c
On Wed, Jul 31, 2013 at 02:52:39PM -0400, Jason Merrill wrote:
http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01536.html
Here, the C++ compiler is wrong to fold away the division by zero,
but given that bug the folding ought to also eliminate the call to
the sanitize function. Seems like you
On Tue, Aug 06, 2013 at 07:07:27PM -0400, Jason Merrill wrote:
I think, what we could do, is to tweak verify_constant like this:
+ /* This is to handle e.g. the goofy 'case 0 * (1 / 0)' case. */
+ if (flag_sanitize SANITIZE_UNDEFINED
+ TREE_CODE (t) == CALL_EXPR
+
On Tue, Aug 06, 2013 at 05:24:08PM -0400, Jason Merrill wrote:
On 08/05/2013 07:24 AM, Marek Polacek wrote:
On Sat, Aug 03, 2013 at 12:24:32PM -0400, Jason Merrill wrote:
Where are the SAVE_EXPRs coming from? It doesn't seem to me that x
needs to be wrapped in a SAVE_EXPR at all in this case
On Wed, Aug 07, 2013 at 10:24:59AM -0400, Jason Merrill wrote:
On 08/07/2013 06:06 AM, Marek Polacek wrote:
I might've misunderstood what you mean. If we drop the hunk above,
then we'll call
error (%q+E is not a constant expression, t);
so, we'll print is not a constant expression
On Tue, Jul 23, 2013 at 01:55:19AM +, Joseph S. Myers wrote:
I have now revised this patch from a year ago in line with my
understanding of how _Generic ought to handle the various special
cases (selector undergoes lvalue-to-rvalue conversion, and decay of
functions and arrays to pointers,
create even the VECTOR_TYPE constant (and, it can
create even REAL_TYPE/COMPLEX_TYPE), as suggested by Marc.
Regtested/bootstrapped on x86_64-linux, ok for trunk and 4.8?
2013-08-09 Marek Polacek pola...@redhat.com
Marc Glisse marc.gli...@inria.fr
PR tree-optimization/57980
On Fri, Aug 09, 2013 at 08:40:00PM +0200, Richard Biener wrote:
Marek Polacek pola...@redhat.com wrote:
In this PR the problem was that when dealing with the gimple assign in
the tailcall optimization, we, when the rhs operand is of a vector
type, need to create -1 also of a vector type
On Mon, Aug 12, 2013 at 12:53:56PM -0700, Caroline Tice wrote:
Ping? Is this one of those I can commit without waiting for approval?
Yes.
Marek
On Tue, Aug 13, 2013 at 12:24:59PM +0200, Jakub Jelinek wrote:
On Mon, Aug 12, 2013 at 10:56:44AM +0200, Marek Polacek wrote:
On Fri, Aug 09, 2013 at 08:40:00PM +0200, Richard Biener wrote:
Marek Polacek pola...@redhat.com wrote:
In this PR the problem was that when dealing
, adjusted with the following; will commit as obvious.
2013-08-13 Marek Polacek pola...@redhat.com
* gcc.dg/pr57980.c: Use vector of two elements, not just one.
--- gcc/testsuite/gcc.dg/pr57980.c.mp 2013-08-13 14:03:22.104617686 +0200
+++ gcc/testsuite/gcc.dg/pr57980.c 2013-08-13 14
for trunk?
2013-08-13 Marek Polacek pola...@redhat.com
* ipa-inline-analysis.c (add_clause): Avoid undefined behavior
when shifting integer.
--- gcc/ipa-inline-analysis.c.mp2013-08-13 14:07:48.632662047 +0200
+++ gcc/ipa-inline-analysis.c 2013-08-13 14:08:16.728770973
When doing bootstrap with ubsan, some files require libpthread to be
linked. This patch adds -lpthread into POSTSTAGE1_LDFLAGS for the
bootstrap-ubsan.
Applying to the ubsan branch.
2013-08-14 Marek Polacek pola...@redhat.com
* bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -lpthread
We ICEd on the following testcase because even though the underlying
types were the same, theirs TREE_TYPEs were not. We can use
TYPE_MAIN_VARIANT to see through the typedefs which confused us.
Tested x86_64-pc-linux-gnu, applying to the ubsan branch.
2013-08-14 Marek Polacek pola
On Wed, Aug 14, 2013 at 11:12:27AM -0700, Xinliang David Li wrote:
Index: ChangeLog
===
--- ChangeLog (revision 201732)
+++ ChangeLog (working copy)
@@ -1,4 +1,8 @@
2013-08-14 Xinliang David Li davi...@google.com
+
Ping.
On Wed, Aug 07, 2013 at 06:12:58PM +0200, Marek Polacek wrote:
On Wed, Aug 07, 2013 at 10:24:59AM -0400, Jason Merrill wrote:
On 08/07/2013 06:06 AM, Marek Polacek wrote:
I might've misunderstood what you mean. If we drop the hunk above,
then we'll call
error (%q+E
On Wed, Aug 07, 2013 at 04:58:03PM +0200, Marek Polacek wrote:
I actually don't know what I prefer more, but if you like this version
more, I'll go with it. Maybe this is better because we don't have to
create SAVE_EXPR and also we avoid one fold_build call. Thanks,
Not creating
I've fixed a few unpleasant bugs; mainly the bug that introduced
various uninitialized variable warnings was bothersome.
Now it is possible to do bootstrap with -fsanitize=undefined,
even though there are some comparison failures at the end.
v3:
- Fix Wuninitialized warnings because of
On Mon, Aug 19, 2013 at 03:45:57PM -0600, Jeff Law wrote:
In this specific instance I was referring to getting meaningful data
out of gdb when I do something like p bb or p e for a block and
edge respectively.
Printing the pointer is useful, but printing information about the
actual
On Thu, Aug 15, 2013 at 05:08:48PM +0200, Marek Polacek wrote:
One patch is not in yet, but that isn't anything important:
http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00376.html
I've now commited this patch:
diff --git a/gcc/ChangeLog.ubsan b/gcc/ChangeLog.ubsan
index 9040b68..695522e
Ping.
On Thu, Aug 15, 2013 at 05:08:48PM +0200, Marek Polacek wrote:
I've fixed a few unpleasant bugs; mainly the bug that introduced
various uninitialized variable warnings was bothersome.
Now it is possible to do bootstrap with -fsanitize=undefined,
even though there are some comparison
On Thu, Aug 22, 2013 at 07:51:07PM +0200, Marek Polacek wrote:
Ping.
I'm withdrawing the ping for now. I'll have to deal with some bootstrap
comparison failures first (ugh!).
Marek
-linux, applying to the ubsan branch.
2013-08-23 Marek Polacek pola...@redhat.com
* ubsan.c (ubsan_typedesc_hasher::hash): Hash the TYPE_UID of the
type.
(ubsan_type_descriptor): Get TYPE_MAIN_VARIANT before initializing
the type descriptor.
--- gcc/ubsan.c.mp
On Fri, Aug 23, 2013 at 02:44:49PM +0200, Jakub Jelinek wrote:
Why not just return TYPE_UID (data-type); ?
Wasn't aware it's enough.
Anyway, once you change the hash table uses into pointer_map, this will
all go away.
Right.
Marek
I noticed I forgot to apply this old patch, already acked by Jason.
It introduces new pointer_sized_int_node, thus we can get rid of
uptr_type function in ubsan, and it allows us to do some clean-up
in asan.c, too.
Tested x86_64-linux, applying to ubsan branch.
2013-08-26 Marek Polacek pola
Ping. The implementation has been commited.
On Thu, Nov 28, 2013 at 01:32:24PM +0100, Marek Polacek wrote:
As promised, this patch on top of this patch by Tobias:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03082.html
adds the documentation for -fsanitize=signed-integer-overflow.
Ok
for it.
Bootstrapped, ran ubsan testsuite on x86_64-unknown-linux-gnu.
Ok for trunk?
2013-12-05 Marek Polacek pola...@redhat.com
PR sanitizer/59333
* ubsan.c: Include rtl.h.
(ubsan_encode_value): Add new parameter. If expanding, assign
a stack slot for DECL_RTL of the temporary
-common.c:5007:9: error: unused variable ‘field’
[-Werror=unused-variable]
tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE,
The following should fix it.
2013-12-05 Marek Polacek pola...@redhat.com
c-family/
* c-common.c (c_sizeof_or_alignof_type): Move a declaration
On Thu, Dec 05, 2013 at 12:37:27PM +0100, Jakub Jelinek wrote:
On Thu, Dec 05, 2013 at 12:26:25PM +0100, Marek Polacek wrote:
--- gcc/ubsan.h.mp 2013-12-05 11:25:18.979469651 +0100
+++ gcc/ubsan.h 2013-12-05 11:25:28.958507098 +0100
@@ -41,7 +41,7 @@ extern tree
On Thu, Dec 05, 2013 at 04:44:29PM +0100, Jakub Jelinek wrote:
On Thu, Dec 05, 2013 at 04:31:20PM +0100, Marek Polacek wrote:
+ }
+ t = build_fold_addr_expr (var);
+ return build2 (COMPOUND_EXPR, TREE_TYPE (t), tem, t);
I would expect you want to use
On Thu, Dec 05, 2013 at 06:22:02PM +0100, Jakub Jelinek wrote:
As a follow-up, please see if all the dg-skip-if -flto
ubsan markings can be removed now.
Unfortunately, not yet. With -flto, we fail with
cclAoIBG.o:(.text+0x14): undefined reference to `.Lubsan_data0.2616'^M
collect2: error: ld
We ICEd on the following testcase with -fsanitize=null and vtable
verification on, because gimple_call_fn returns NULL for UBSAN_*
internal functions. Fixed by checking the result for NULL before
accessing its TREE_CODE.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2013-12-09 Marek
On Mon, Dec 09, 2013 at 03:29:38PM +0100, Jakub Jelinek wrote:
On Mon, Dec 09, 2013 at 03:23:30PM +0100, Marek Polacek wrote:
We ICEd on the following testcase with -fsanitize=null and vtable
verification on, because gimple_call_fn returns NULL for UBSAN_*
internal functions. Fixed
-gnu and
x86_64-unknown-linux-gnu.
Ok for trunk?
[1] http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00609.html
2013-12-09 Marek Polacek pola...@redhat.com
PR sanitizer/59399
* expr.c (expand_expr_real_1): Remove assert dealing with
internal calls and turn
-12-09 Marek Polacek pola...@redhat.com
PR sanitizer/59437
* vtable-verify.c (var_is_used_for_virtual_call_p): Check the
return value of gimple_call_fn. Use is_gimple_call/is_gimple_assign
instead of gimple_code.
testsuite/
* g++.dg/ubsan/pr59437.C: New
I noticed this bug a while ago on ppc64 and now I reproduced it even
on x86_64 with -m32. The problem was that we were using add_optab even
when dealing with MINUS_EXPR; we should use sub_optab instead.
Regtested on x86_64-linux (with both -m32/-m64), ok for trunk?
2013-12-14 Marek Polacek
This adds two sanity tests for signed-integer-overflow sanitization.
One variant uses asms to prevent ccp/... from optimizing away the
computations. Nothing in these tests should fail.
Regtested on x86_64-unknown-linux-gnu and powerpc64-unknown-linux-gnu,
ok for trunk?
2013-12-14 Marek Polacek
This adds more testing of unary -.
Regtested on x86_64-linux with -m32/-m64, ok for trunk?
2013-12-14 Marek Polacek pola...@redhat.com
testsuite/
* c-c++-common/ubsan/overflow-negate-1.c: Add more testing. Don't
require int128 target.
* c-c++-common/ubsan/overflow
Regtested on x86_64-linux with -m32/-m64.
Ok?
2013-12-17 Marek Polacek pola...@redhat.com
testsuite/
* c-c++-common/ubsan/overflow-int128.c: New test.
--- gcc/testsuite/c-c++-common/ubsan/overflow-int128.c.mp 2013-12-17
16:54:28.123468111 +0100
+++ gcc/testsuite/c-c++-common
On Tue, Dec 17, 2013 at 06:50:24PM +0100, Jakub Jelinek wrote:
Isn't this undefined behavior in C? I mean, shouldn't you
shift up (unsigned __int128) 1 and only cast to (__int128) at the end?
Oh my, how could I.
Yeah, (__int128) 1 127 is UB. Fixed below, ok now?
2013-12-17 Marek Polacek
Bootstrap with -fsanitize=undefined revealed that the alg variable
may be used uninitialized. Or at least gcc thinks so. This patch
initializes it to 0.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2013-12-18 Marek Polacek pola...@redhat.com
* config/i386/i386.c
On Wed, Dec 18, 2013 at 02:45:12PM +0100, Jakub Jelinek wrote:
On Wed, Dec 18, 2013 at 02:39:44PM +0100, Marek Polacek wrote:
Bootstrap with -fsanitize=undefined revealed that the alg variable
may be used uninitialized. Or at least gcc thinks so. This patch
initializes it to 0
We ICEd on invalid testcases with auto, because lookup_conversions
got template_type_parm as a parameter and the TYPE_BINFO didn't like
it. Fixed by checking for RECORD_OR_UNION_TYPE_P first.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2013-12-20 Marek Polacek pola...@redhat.com
__builtin_{FILE,FUNCTION} had wrong return types, thus fixed.
Tested by make html and links -g. Ok for trunk?
2014-01-03 Marek Polacek pola...@redhat.com
PR other/59661
* doc/extend.texi: Fix the return value of __builtin_FUNCTION and
__builtin_FILE.
--- gcc/doc
Marek Polacek pola...@redhat.com
PR c/57773
c/
* c-decl.c (check_bitfield_type_and_width): Warn for enum bit-fields
only in ISO C.
testsuite/
* gcc.dg/pr57773.c: New test.
--- gcc/c/c-decl.c.mp 2014-01-03 13:50:37.041997222 +0100
+++ gcc/c/c-decl.c 2014-01-03
,
2014-01-06 Marek Polacek pola...@redhat.com
PR c/57773
* doc/implement-c.texi: Mention that other integer types are
permitted as bit-field types in strictly conforming mode.
c/
* c-decl.c (check_bitfield_type_and_width): Warn for implementation
defined
In case we're dealing with (*)[N] types, we should strip the
ARRAY_TYPEs prior to getting the type name. Otherwise we segv, since
the DECL_NAME is NULL.
Regtested on x86_64-linux, ok for trunk?
2014-01-07 Marek Polacek pola...@redhat.com
PR sanitizer/59667
* ubsan.c
We can also get NULL for the default definition, so we need to handle that
before calling has_zero_uses on it.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-01-08 Marek Polacek pola...@redhat.com
PR middle-end/59669
* omp-low.c (simd_clone_adjust): Don't crash
On Wed, Jan 08, 2014 at 04:14:06PM +0100, Jakub Jelinek wrote:
On Wed, Jan 08, 2014 at 04:09:08PM +0100, Marek Polacek wrote:
We can also get NULL for the default definition, so we need to handle that
before calling has_zero_uses on it.
Bootstrapped/regtested on x86_64-linux, ok
/unions doesn't really make sense and this patch forbids that.
Note that GCC permits a structure/union to have no members, but it's only
an extension, in C11 it's undefined behavior.
Regtested/bootstrapped on x86_64, ok for trunk?
2014-01-13 Marek Polacek pola...@redhat.com
PR c/58346
c
On Mon, Jan 13, 2014 at 05:32:26PM +0100, Marek Polacek wrote:
This doesn't really fix the PR, but solves a related issue, where we
have e.g.
struct U {};
static struct U b[6];
int foo (struct U *p, struct U *q)
{
return q - p;
}
int main()
{
return foo (b[0], b[4
On Mon, Jan 13, 2014 at 05:48:59PM +0100, Marek Polacek wrote:
The patch will need some tweaking, I realized that e.g. for struct S {
union {}; }; it doesn't do the right thing...
Done in the patch below. CCing Jason for the C++ part. Does this
look sane now?
Regtested/bootstrapped on x86_64
On Tue, Jan 14, 2014 at 06:52:00PM +0100, Florian Weimer wrote:
On 01/13/2014 09:48 PM, Marek Polacek wrote:
+bool
+pointer_to_zero_sized_aggr_p (tree t)
+{
+ t = strip_pointer_operator (t);
+ if (RECORD_OR_UNION_TYPE_P (t)
+ TYPE_SIZE (t)
+ integer_zerop (TYPE_SIZE (t
On Tue, Jan 14, 2014 at 09:42:37PM +, Joseph S. Myers wrote:
On Mon, 13 Jan 2014, Marek Polacek wrote:
+/* Return true if T is a pointer to a zero-sized struct/union. */
+
+bool
+pointer_to_zero_sized_aggr_p (tree t)
+{
+ t = strip_pointer_operator (t
On Wed, Jan 15, 2014 at 11:35:40AM +0100, Jakub Jelinek wrote:
On Wed, Jan 15, 2014 at 11:27:37AM +0100, Marek Polacek wrote:
Perhaps, but I don't think we can do it easily. Consider
int
foo (int *p, int *q)
{
return p - q;
}
That is not a difference of pointers to zero sized
We ICE on the following (invalid) testcase, because the DECL_ARG_TYPE
is error_mark_node and useless_type_conversion_p doesn't check that
it operates on a type.
Regtested/bootstrapped on x86_64-linux, ok for trunk/4.8/4.7?
2014-01-15 Marek Polacek pola...@redhat.com
PR middle-end
On Wed, Jan 15, 2014 at 01:43:18PM -0800, Richard Henderson wrote:
On 01/15/2014 08:37 AM, H.J. Lu wrote:
We should add a testcase to verify this.
I included the following testcase with the commit. I couldn't find a way
to test this properly generically, so I just went with the obvious
-ENOPATCH
On Wed, Jan 15, 2014 at 10:37:04PM +, Iyer, Balaji V wrote:
+2014-01-15 Balaji V. Iyer balaji.v.i...@intel.com
+
+ PR c/59825
+ * c-array-notation.c (expand_array_notation_exprs): Added COMPOUND_EXPR
+ case.
+
Add
--- a/gcc/c/c-array-notation.c
+++
On Thu, Jan 16, 2014 at 12:50:10PM +0100, Eric Botcazou wrote:
+/* Return true if T is a pointer to a zero-sized struct/union. */
+
+bool
+pointer_to_zero_sized_aggr_p (tree t)
+{
+ t = strip_pointer_operator (t);
+ return ((RECORD_OR_UNION_TYPE_P (t) || TREE_CODE (t) ==
On Wed, Jan 15, 2014 at 09:23:06PM +, Joseph S. Myers wrote:
On Wed, 15 Jan 2014, Marek Polacek wrote:
+/* Return true if T is a pointer to a zero-sized struct/union. */
+
+bool
+pointer_to_zero_sized_aggr_p (tree t)
+{
+ t = strip_pointer_operator (t);
+ return
On Thu, Jan 16, 2014 at 01:18:59PM -0800, Aldy Hernandez wrote:
I'm not a C++ expert, but my understanding was that in C++ you don't
need a typedef to use the following structure by name
(cilk_for_information). So you can just declare struct
cilk_for_information {...} and instantiate it with
This is the real fix for PR58346. I'd say the easiest solution is
just not fold the zero-sized elements.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-01-17 Marek Polacek pola...@redhat.com
PR c/58346
* gimple-fold.c (fold_array_ctor_reference): Don't fold
for trunk/4.8/4.7?
2014-01-17 Marek Polacek pola...@redhat.com
PR c++/59838
cp/
* cvt.c (ocp_convert): Don't segfault on non-existing
ENUM_UNDERLYING_TYPE.
testsuite/
* g++.dg/diagnostic/pr59838.C: New test.
--- gcc/cp/cvt.c.mp32014-01-17 12:01:20.926793491 +0100
adjust one testcase and a header in libdecnumber.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2014-01-21 Marek Polacek pola...@redhat.com
PR c/59871
c/
* c-typeck.c (build_compound_expr): Warn even for right-hand operand
of comma expression
On Tue, Jan 21, 2014 at 09:18:17PM +0100, Marc Glisse wrote:
On Tue, 21 Jan 2014, Marek Polacek wrote:
--- gcc/libdecnumber/decNumberLocal.h.mp 2014-01-21 18:34:32.235540589
+0100
+++ gcc/libdecnumber/decNumberLocal.h2014-01-21 19:04:12.173243034
+0100
@@ -155,8 +155,10
On Tue, Jan 21, 2014 at 07:50:13PM +0100, Jakub Jelinek wrote:
On Tue, Jan 21, 2014 at 07:38:10PM +0100, Marek Polacek wrote:
--- gcc/gcc/c/c-typeck.c.mp 2014-01-21 11:59:33.221215248 +0100
+++ gcc/gcc/c/c-typeck.c2014-01-21 18:10:53.900279750 +0100
@@ -4757,6 +4757,18
On Tue, Jan 21, 2014 at 11:34:42PM +0100, Jakub Jelinek wrote:
On Tue, Jan 21, 2014 at 11:30:58PM +0100, Marek Polacek wrote:
I made another small change: in the second hunk, in
emit_side_effect_warnings, I got rid of the while, since it seems to
me we never get COMPOUND_EXPR
601 - 700 of 4195 matches
Mail list logo