public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633).
@ 2015-10-20 11:17 Maxim Ostapenko
  2015-10-20 11:20 ` [PATCH v2 1/6] " Maxim Ostapenko
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:17 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

Hi,

this is the second attempt to perform libsanitizer merge from upstream. 
In previous patch set ( 
https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01212.html) we have 
revealed an issue with heuristic for old/new style ubsan_data that was 
needed to be fixed upstream + some errors in compiler changes were 
found. I thought that it would me too messy to proceed review in the 
previous thread, so creating the new one.

The first patch is the merge itself. Since the heuristic fix for old/new 
style ubsan_data selection was applied upstream, I'm bumping revision to 
r250806.
Since there aren't significant changes from r249633, I think this should 
be fine.

The second one combines all compiler-related changes and addresses 
Jakub's nits from previous review.

Patches 3, 4 and 5 are applied to library and were preapproved in 
previous review, but I'm attaching them here to form the full patch set.

In patch 6, I'm trying to add a brief instruction how to perform the 
merge. This is just a documentation patch.

Tested and {A, UB}San bootstrapped on x86-linux-gnu, x86_64-linux-gnu 
and aarch64-linux-gnu targets.

Thanks,
-Maxim

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

* [PATCH v2 1/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
@ 2015-10-20 11:20 ` Maxim Ostapenko
  2015-10-20 11:56   ` Jakub Jelinek
  2015-10-20 11:22 ` [PATCH v2 2/6] " Maxim Ostapenko
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:20 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

This is the merge itself. Added DCAN_SANITIZE_UB={0, 1} and nuked 
DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 (not used now) in corresponding 
Makefiles.

[-- Attachment #2: libsanitizer-249633-3.tar.bz --]
[-- Type: application/x-bzip, Size: 258698 bytes --]

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

* [PATCH v2 2/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
  2015-10-20 11:20 ` [PATCH v2 1/6] " Maxim Ostapenko
@ 2015-10-20 11:22 ` Maxim Ostapenko
  2015-10-20 12:02   ` Jakub Jelinek
  2015-10-20 11:25 ` [PATCH v2 0/6] " Maxim Ostapenko
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:22 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

This patch introduces required compiler changes. Now, we don't version 
asan_init, we have a special __asan_version_mismatch_check_v[n] symbol 
for this. asan_stack_malloc_[n] doesn't take a local stack as a second 
parameter anymore, so don't pass it. Also, ubsan_instrument_float_cast 
was adjusted to pass source location for libubsan if it is possible.

[-- Attachment #2: 2.diff --]
[-- Type: text/x-patch, Size: 39609 bytes --]

gcc/ChangeLog:

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

gcc/

	* asan.c (asan_emit_stack_protection): Don't pass local stack to
	asan_stack_malloc_[n] anymore. Check if asan_stack_malloc_[n] returned
	NULL and use local stack than.
	(asan_finish_file): Insert __asan_version_mismatch_check_v[n] call
	in addition to __asan_init.
	* sanitizer.def (BUILT_IN_ASAN_INIT): Rename to __asan_init.
	(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK): Add new builtin call.
	* asan.h (asan_intercepted_p): Handle new string builtins.
	* ubsan.c (ubsan_use_new_style_p): New function.
	(ubsan_instrument_float_cast): If location is unknown, assign
	input_location to loc. Propagate loc to ubsan_create_data if
	ubsan_use_new_style_p returned true.

config/

	* bootstrap-asan.mk: Replace ASAN_OPTIONS=detect_leaks with
	LSAN_OPTIONS=detect_leaks.

gcc/testsuite/ChangeLog:

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	* c-c++-common/ubsan/float-cast-overflow-10.c: Adjust test.
	* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
	* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
	* g++.dg/asan/default-options-1.C: Likewise.

Index: gcc/asan.c
===================================================================
--- gcc/asan.c	(revision 228817)
+++ gcc/asan.c	(working copy)
@@ -1132,12 +1132,16 @@
       snprintf (buf, sizeof buf, "__asan_stack_malloc_%d",
 		use_after_return_class);
       ret = init_one_libfunc (buf);
-      rtx addr = convert_memory_address (ptr_mode, base);
-      ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2,
+      ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 1,
 				     GEN_INT (asan_frame_size
 					      + base_align_bias),
-				     TYPE_MODE (pointer_sized_int_node),
-				     addr, ptr_mode);
+				     TYPE_MODE (pointer_sized_int_node));
+      /* __asan_stack_malloc_[n] returns a pointer to fake stack if succeeded
+	 and NULL otherwise.  Check RET value is NULL here and jump over the
+	 BASE reassignment in this case.  Otherwise, reassign BASE to RET.  */
+      int very_unlikely = REG_BR_PROB_BASE / 2000 - 1;
+      emit_cmp_and_jump_insns (ret, const0_rtx, EQ, NULL_RTX,
+			       VOIDmode, 0, lab, very_unlikely);
       ret = convert_memory_address (Pmode, ret);
       emit_move_insn (base, ret);
       emit_label (lab);
@@ -2470,6 +2474,8 @@
     {
       tree fn = builtin_decl_implicit (BUILT_IN_ASAN_INIT);
       append_to_statement_list (build_call_expr (fn, 0), &asan_ctor_statements);
+      fn = builtin_decl_implicit (BUILT_IN_ASAN_VERSION_MISMATCH_CHECK);
+      append_to_statement_list (build_call_expr (fn, 0), &asan_ctor_statements);
     }
   FOR_EACH_DEFINED_VARIABLE (vnode)
     if (TREE_ASM_WRITTEN (vnode->decl)
Index: gcc/sanitizer.def
===================================================================
--- gcc/sanitizer.def	(revision 228817)
+++ gcc/sanitizer.def	(working copy)
@@ -27,8 +27,11 @@
    for other FEs by asan.c.  */
 
 /* Address Sanitizer */
-DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init_v4",
+DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init",
 		      BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
+DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK,
+		      "__asan_version_mismatch_check_v6",
+		      BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
 /* Do not reorder the BUILT_IN_ASAN_{REPORT,CHECK}* builtins, e.g. cfgcleanup.c
    relies on this order.  */
 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1, "__asan_report_load1",
Index: gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-10.c
===================================================================
--- gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-10.c	(revision 228817)
+++ gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-10.c	(working copy)
@@ -10,70 +10,37 @@
 
 /* _Decimal32 */
 /* { dg-output "value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* _Decimal64 */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* _Decimal128 */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'" } */
Index: gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-8.c
===================================================================
--- gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-8.c	(revision 228817)
+++ gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-8.c	(working copy)
@@ -100,106 +100,44 @@
 
 /* float */
 /* { dg-output "value -129 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 128 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value (-129|-1) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value (128|256) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 256 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -32769 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 32768 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 65536 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* No error for float and __int128 unsigned max value, as ui128_MAX is +Inf in float.  */
 /* double */
 /* { dg-output "\[^\n\r]*value -129 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 128 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value (-129|-1) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value (128|256) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 256 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -32769 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 32768 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 65536 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* long double */
 /* { dg-output "\[^\n\r]*value -129 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 128 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value (-129|-1) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value (128|256) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 256 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -32769 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
-/* { dg-output "\[^\n\r]*value 32768 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 65536 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ilp32 || lp64 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" { target { ! { ilp32 || lp64 } } } } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long unsigned int'" } */
-/* { dg-output "(\n|\r\n|\r)\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target { int128 } } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128 unsigned'" { target { int128 } } } */
Index: gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-9.c
===================================================================
--- gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-9.c	(revision 228817)
+++ gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-9.c	(working copy)
@@ -7,55 +7,29 @@
 
 /* __float80 */
 /* { dg-output "value -129 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 128 is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value (-129|-1) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value (128|256) is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 256 is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -32769 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 32768 is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value 65536 is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
 /* { dg-output "\[^\n\r]*value -1 is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
-/* { dg-output "\[^\n\r]*value \[0-9.e+-]* is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
 /* __float128 */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'signed char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned char'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'short unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type 'long long unsigned int'\[^\n\r]*(\n|\r\n|\r)" } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type '__int128'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
 /* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type '__int128 unsigned'\[^\n\r]*(\n|\r\n|\r)" { target int128 } } */
-/* { dg-output "\[^\n\r]*value <unknown> is outside the range of representable values of type '__int128 unsigned'" { target int128 } } */
Index: gcc/testsuite/g++.dg/asan/default-options-1.C
===================================================================
--- gcc/testsuite/g++.dg/asan/default-options-1.C	(revision 228817)
+++ gcc/testsuite/g++.dg/asan/default-options-1.C	(working copy)
@@ -12,4 +12,4 @@
   return 0;
 }
 
-// { dg-output "Using the defaults from __asan_default_options:.* foo=bar.*(\n|\r\n|\r)" }
+// { dg-output "WARNING: found 1 unrecognized flag\\(s\\):(\n|\r\n|\r).*foo(\n|\r\n|\r)" }
Index: gcc/ubsan.c
===================================================================
--- gcc/ubsan.c	(revision 228817)
+++ gcc/ubsan.c	(working copy)
@@ -1472,6 +1472,30 @@
   *gsi = gsi_for_stmt (stmt);
 }
 
+/* Determine if we can propagate given LOCATION to ubsan_data descriptor to use
+   new style handlers.  Libubsan uses heuristics to destinguish between old and
+   new styles and relies on these properties for filename:
+
+   a) Location's filename must not be NULL.
+   b) Location's filename must not be equal to "".
+   c) Location's filename must not be equal to "\1".
+   d) First two bytes of filename msut not contain '\xff' symbol.  */
+
+static bool
+ubsan_use_new_style_p (location_t loc)
+{
+  if (loc == UNKNOWN_LOCATION)
+    return false;
+
+  expanded_location xloc = expand_location (loc);
+  if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
+      || strncmp (xloc.file, "", 1) == 0 || xloc.file[0] == '\xff'
+      || xloc.file[1] == '\xff')
+    return false;
+
+  return true;
+}
+
 /* Instrument float point-to-integer conversion.  TYPE is an integer type of
    destination, EXPR is floating-point expression.  ARG is what to pass
    the libubsan call as value, often EXPR itself.  */
@@ -1484,6 +1508,7 @@
   machine_mode mode = TYPE_MODE (expr_type);
   int prec = TYPE_PRECISION (type);
   bool uns_p = TYPE_UNSIGNED (type);
+  if (!loc) loc = input_location;
 
   /* Float to integer conversion first truncates toward zero, so
      even signed char c = 127.875f; is not problematic.
@@ -1580,9 +1605,19 @@
     fn = build_call_expr_loc (loc, builtin_decl_explicit (BUILT_IN_TRAP), 0);
   else
     {
+      location_t *loc_ptr = NULL;
+      unsigned num_locations = 0;
+      /* Figure out if we can propagate location to ubsan_data and use new
+         style handlers in libubsan.  */
+      if (ubsan_use_new_style_p (loc))
+	{
+	  loc_ptr = &loc;
+	  num_locations = 1;
+	}
       /* Create the __ubsan_handle_float_cast_overflow fn call.  */
-      tree data = ubsan_create_data ("__ubsan_float_cast_overflow_data", 0,
-				     NULL, ubsan_type_descriptor (expr_type),
+      tree data = ubsan_create_data ("__ubsan_float_cast_overflow_data",
+				     num_locations, loc_ptr,
+				     ubsan_type_descriptor (expr_type),
 				     ubsan_type_descriptor (type), NULL_TREE,
 				     NULL_TREE);
       enum built_in_function bcode
Index: config/bootstrap-asan.mk
===================================================================
--- config/bootstrap-asan.mk	(revision 228817)
+++ config/bootstrap-asan.mk	(working copy)
@@ -1,7 +1,7 @@
 # This option enables -fsanitize=address for stage2 and stage3.
 
 # Suppress LeakSanitizer in bootstrap.
-export ASAN_OPTIONS="detect_leaks=0"
+export LSAN_OPTIONS="detect_leaks=0"
 
 STAGE2_CFLAGS += -fsanitize=address
 STAGE3_CFLAGS += -fsanitize=address

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

* Re: [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
  2015-10-20 11:20 ` [PATCH v2 1/6] " Maxim Ostapenko
  2015-10-20 11:22 ` [PATCH v2 2/6] " Maxim Ostapenko
@ 2015-10-20 11:25 ` Maxim Ostapenko
  2015-10-20 11:28 ` [PATCH v2 4/6] " Maxim Ostapenko
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:25 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

This is just reapplied patch for SPARC by David S. Miller. The patch was 
preapproved here: 
(https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01214.html).

[-- Attachment #2: 3.diff --]
[-- Type: text/x-patch, Size: 5094 bytes --]

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	PR sanitizer/63958
	Reapply:
	2014-10-14  David S. Miller  <davem@davemloft.net>

	* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
	Define at __kernel_time_t, as needed for sparc.
	(struct __old_kernel_stat): Don't check if __sparc__ is defined.
	* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer): Define struct___old_kernel_stat_sz,
	struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
	(__sanitizer_ipc_perm): Adjust for sparc targets.
	(__sanitizer_shmid_ds): Likewsie.
	(__sanitizer_sigaction): Likewise.
	(IOC_SIZE): Likewsie.

Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc	(revision 250059)
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc	(working copy)
@@ -38,6 +38,7 @@
 #define uid_t __kernel_uid_t
 #define gid_t __kernel_gid_t
 #define off_t __kernel_off_t
+#define time_t __kernel_time_t
 // This header seems to contain the definitions of _kernel_ stat* structs.
 #include <asm/stat.h>
 #undef ino_t
@@ -62,7 +63,7 @@
 }  // namespace __sanitizer
 
 #if !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__aarch64__)\
-                            && !defined(__mips__)
+                            && !defined(__mips__) && !defined(__sparc__)
 COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));
 #endif
 
Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	(revision 250059)
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	(working copy)
@@ -83,6 +83,14 @@
   const unsigned struct_kernel_stat_sz = 144;
   #endif
   const unsigned struct_kernel_stat64_sz = 104;
+#elif defined(__sparc__) && defined(__arch64__)
+  const unsigned struct___old_kernel_stat_sz = 0;
+  const unsigned struct_kernel_stat_sz = 104;
+  const unsigned struct_kernel_stat64_sz = 144;
+#elif defined(__sparc__) && !defined(__arch64__)
+  const unsigned struct___old_kernel_stat_sz = 0;
+  const unsigned struct_kernel_stat_sz = 64;
+  const unsigned struct_kernel_stat64_sz = 104;
 #endif
   struct __sanitizer_perf_event_attr {
     unsigned type;
@@ -105,7 +113,7 @@
 
 #if defined(__powerpc64__)
   const unsigned struct___old_kernel_stat_sz = 0;
-#else
+#elif !defined(__sparc__)
   const unsigned struct___old_kernel_stat_sz = 32;
 #endif
 
@@ -184,6 +192,18 @@
     unsigned short __pad1;
     unsigned long __unused1;
     unsigned long __unused2;
+#elif defined(__sparc__)
+# if defined(__arch64__)
+    unsigned mode;
+    unsigned short __pad1;
+# else
+    unsigned short __pad1;
+    unsigned short mode;
+    unsigned short __pad2;
+# endif
+    unsigned short __seq;
+    unsigned long long __unused1;
+    unsigned long long __unused2;
 #else
     unsigned short mode;
     unsigned short __pad1;
@@ -201,6 +221,26 @@
 
   struct __sanitizer_shmid_ds {
     __sanitizer_ipc_perm shm_perm;
+  #if defined(__sparc__)
+  # if !defined(__arch64__)
+    u32 __pad1;
+  # endif
+    long shm_atime;
+  # if !defined(__arch64__)
+    u32 __pad2;
+  # endif
+    long shm_dtime;
+  # if !defined(__arch64__)
+    u32 __pad3;
+  # endif
+    long shm_ctime;
+    uptr shm_segsz;
+    int shm_cpid;
+    int shm_lpid;
+    unsigned long shm_nattch;
+    unsigned long __glibc_reserved1;
+    unsigned long __glibc_reserved2;
+  #else    
   #ifndef __powerpc__
     uptr shm_segsz;
   #elif !defined(__powerpc64__)
@@ -238,6 +278,7 @@
     uptr __unused4;
     uptr __unused5;
   #endif
+#endif
   };
 #elif SANITIZER_FREEBSD
   struct __sanitizer_ipc_perm {
@@ -555,9 +596,13 @@
 #else
     __sanitizer_sigset_t sa_mask;
 #ifndef __mips__
+#if defined(__sparc__)
+    unsigned long sa_flags;
+#else
     int sa_flags;
 #endif
 #endif
+#endif
 #if SANITIZER_LINUX
     void (*sa_restorer)();
 #endif
@@ -799,7 +844,7 @@
 
 #define IOC_NRBITS 8
 #define IOC_TYPEBITS 8
-#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__)
+#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || defined(__sparc__)
 #define IOC_SIZEBITS 13
 #define IOC_DIRBITS 3
 #define IOC_NONE 1U
@@ -829,7 +874,17 @@
 #define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK)
 #define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK)
 #define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK)
+
+#if defined(__sparc__)
+// In sparc the 14 bits SIZE field overlaps with the
+// least significant bit of DIR, so either IOC_READ or
+// IOC_WRITE shall be 1 in order to get a non-zero SIZE.
+# define IOC_SIZE(nr)                       \
+  ((((((nr) >> 29) & 0x7) & (4U|2U)) == 0)? \
+   0 : (((nr) >> 16) & 0x3fff))
+#else
 #define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
+#endif
 
   extern unsigned struct_ifreq_sz;
   extern unsigned struct_termios_sz;

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

* [PATCH v2 4/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
                   ` (2 preceding siblings ...)
  2015-10-20 11:25 ` [PATCH v2 0/6] " Maxim Ostapenko
@ 2015-10-20 11:28 ` Maxim Ostapenko
  2015-10-20 11:30 ` [PATCH v2 5/6] " Maxim Ostapenko
  2015-10-20 11:45 ` [PATCH v2 6/6] " Maxim Ostapenko
  5 siblings, 0 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:28 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 167 bytes --]

This is a reapplied Jakub's patch for disabling ODR violation detection. 
The patch was preapproved here: 
(https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01215.html).

[-- Attachment #2: 4.diff --]
[-- Type: text/x-patch, Size: 1134 bytes --]

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	PR bootstrap/63888
	Reapply:
	2015-02-20  Jakub Jelinek  <jakub@redhat.com>

	* asan/asan_globals.cc (RegisterGlobal): Disable detect_odr_violation
	support until it is rewritten upstream.

	* c-c++-common/asan/pr63888.c: New test.

Index: libsanitizer/asan/asan_globals.cc
===================================================================
--- libsanitizer/asan/asan_globals.cc	(revision 250059)
+++ libsanitizer/asan/asan_globals.cc	(working copy)
@@ -146,7 +146,9 @@
   CHECK(AddrIsInMem(g->beg));
   CHECK(AddrIsAlignedByGranularity(g->beg));
   CHECK(AddrIsAlignedByGranularity(g->size_with_redzone));
-  if (flags()->detect_odr_violation) {
+  // This "ODR violation" detection is fundamentally incompatible with
+  // how GCC registers globals.  Disable as useless until rewritten upstream.
+  if (0 && flags()->detect_odr_violation) {
     // Try detecting ODR (One Definition Rule) violation, i.e. the situation
     // where two globals with the same name are defined in different modules.
     if (__asan_region_is_poisoned(g->beg, g->size_with_redzone)) {

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

* [PATCH v2 5/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
                   ` (3 preceding siblings ...)
  2015-10-20 11:28 ` [PATCH v2 4/6] " Maxim Ostapenko
@ 2015-10-20 11:30 ` Maxim Ostapenko
  2015-10-20 11:45 ` [PATCH v2 6/6] " Maxim Ostapenko
  5 siblings, 0 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:30 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

This patch adjusts the fix for 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771 to extract the last 
PC from the stack frame if no valid FP is available for ARM. The patch 
was preapproved here: 
(https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01217.html).

[-- Attachment #2: 5.diff --]
[-- Type: text/x-patch, Size: 906 bytes --]

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
	compiled code with GCC when extracting the caller PC for ARM if no
	valid frame pointer is available.

Index: libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(revision 250059)
+++ libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(working copy)
@@ -62,8 +62,8 @@
   // Nope, this does not look right either. This means the frame after next does
   // not have a valid frame pointer, but we can still extract the caller PC.
   // Unfortunately, there is no way to decide between GCC and LLVM frame
-  // layouts. Assume LLVM.
-  return bp_prev;
+  // layouts. Assume GCC.
+  return bp_prev - 1;
 #else
   return (uhwptr*)bp;
 #endif

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

* [PATCH v2 6/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
                   ` (4 preceding siblings ...)
  2015-10-20 11:30 ` [PATCH v2 5/6] " Maxim Ostapenko
@ 2015-10-20 11:45 ` Maxim Ostapenko
  2015-10-20 12:06   ` Jakub Jelinek
  2015-10-21  9:19   ` Yury Gribov
  5 siblings, 2 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 11:45 UTC (permalink / raw)
  To: Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

In this patch, I'm trying to add a general instruction how to perform 
the merge. This is just a documentation patch, any suggestions and 
opinions are welcome.

[-- Attachment #2: 6.diff --]
[-- Type: text/x-patch, Size: 1776 bytes --]

Index: libsanitizer/HOWTO_MERGE
===================================================================
--- libsanitizer/HOWTO_MERGE	(revision 0)
+++ libsanitizer/HOWTO_MERGE	(working copy)
@@ -0,0 +1,26 @@
+In general, merging process should not be very difficult, but we need to
+track various ABI changes and GCC-specific patches carefully.  Here is a
+general list of actions required to perform the merge:
+
+- Checkout recent GCC tree.
+- Run merge.sh script from libsanitizer directory.
+- Modify Makefile.am files into asan/tsan/lsan/ubsan/sanitizer_common/interception
+  directories if needed.  In particular, you may need to add new source files
+  and remove old ones in source files list, add new flags to {C, CXX}FLAGS if
+  needed and update DEFS with new defined variables.
+- Apply all needed GCC-specific patches to libsanitizer (note that some of
+  them might be already included to upstream).
+- Apply all necessary compiler changes.  Be especially careful here, you must
+  not break ABI between compiler and library.
+- Modify configure.ac file if needed (e.g. if you need to add link against new
+  library for sanitizer lilbs).
+- Remove unused (deleted by merge) files from all source and include
+  directories.  Be especially careful with headers, because they aren't listed
+  in Makefiles explicitly.
+- Regenerate configure script and all Makefiles by autoreconf.  You should use
+  exactly the same autotools version as for other GCC directories (current
+  version is 2.64, https://www.gnu.org/software/automake/faq/autotools-faq.html
+  for details how to install/use it).
+- Run regression testing on at least three platforms (e.g. x86-linux-gnu,
+  x86_64-linux-gnu, aarch64-linux-gnu).
+- Run {A, UB}San bootstrap on at least three platforms.

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

* Re: [PATCH v2 1/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:20 ` [PATCH v2 1/6] " Maxim Ostapenko
@ 2015-10-20 11:56   ` Jakub Jelinek
  2015-10-20 14:14     ` Maxim Ostapenko
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Jelinek @ 2015-10-20 11:56 UTC (permalink / raw)
  To: Maxim Ostapenko
  Cc: Kostya Serebryany, GCC Patches, Dmitry Vyukov, Marek Polacek,
	Yury Gribov, Slava Garbuzov, Vyacheslav Barinov

On Tue, Oct 20, 2015 at 02:18:25PM +0300, Maxim Ostapenko wrote:
> This is the merge itself. Added DCAN_SANITIZE_UB={0, 1} and nuked
> DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 (not used now) in corresponding
> Makefiles.

Ok.

	Jakub

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

* Re: [PATCH v2 2/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:22 ` [PATCH v2 2/6] " Maxim Ostapenko
@ 2015-10-20 12:02   ` Jakub Jelinek
  0 siblings, 0 replies; 12+ messages in thread
From: Jakub Jelinek @ 2015-10-20 12:02 UTC (permalink / raw)
  To: Maxim Ostapenko
  Cc: Kostya Serebryany, GCC Patches, Dmitry Vyukov, Marek Polacek,
	Yury Gribov, Slava Garbuzov, Vyacheslav Barinov

On Tue, Oct 20, 2015 at 02:19:51PM +0300, Maxim Ostapenko wrote:
> +   a) Location's filename must not be NULL.
> +   b) Location's filename must not be equal to "".
> +   c) Location's filename must not be equal to "\1".
> +   d) First two bytes of filename msut not contain '\xff' symbol.  */

must

> +
> +static bool
> +ubsan_use_new_style_p (location_t loc)
> +{
> +  if (loc == UNKNOWN_LOCATION)
> +    return false;
> +
> +  expanded_location xloc = expand_location (loc);
> +  if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
> +      || strncmp (xloc.file, "", 1) == 0 || xloc.file[0] == '\xff'

I'd use || xloc.file == '\0' || xloc.file[0] == '\xff
instead, but not a big deal for me.

> +      || xloc.file[1] == '\xff')
> +    return false;
> +
> +  return true;
> +}
> +

Ok with the typo fix.

	Jakub

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

* Re: [PATCH v2 6/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:45 ` [PATCH v2 6/6] " Maxim Ostapenko
@ 2015-10-20 12:06   ` Jakub Jelinek
  2015-10-21  9:19   ` Yury Gribov
  1 sibling, 0 replies; 12+ messages in thread
From: Jakub Jelinek @ 2015-10-20 12:06 UTC (permalink / raw)
  To: Maxim Ostapenko
  Cc: Kostya Serebryany, GCC Patches, Dmitry Vyukov, Marek Polacek,
	Yury Gribov, Slava Garbuzov, Vyacheslav Barinov

On Tue, Oct 20, 2015 at 02:29:44PM +0300, Maxim Ostapenko wrote:
> In this patch, I'm trying to add a general instruction how to perform the
> merge. This is just a documentation patch, any suggestions and opinions are
> welcome.

I'd add a line that the diff in lib/asan/tests tests since the last
merge to those tests (looking at gcc/testsuite/ChangeLog*, the 2014-05-30 entry
mentions r209283) should be incorporated into the gcc testsuite too (if
possible).

Otherwise, LGTM.

> Index: libsanitizer/HOWTO_MERGE
> ===================================================================
> --- libsanitizer/HOWTO_MERGE	(revision 0)
> +++ libsanitizer/HOWTO_MERGE	(working copy)
> @@ -0,0 +1,26 @@
> +In general, merging process should not be very difficult, but we need to
> +track various ABI changes and GCC-specific patches carefully.  Here is a
> +general list of actions required to perform the merge:
> +
> +- Checkout recent GCC tree.
> +- Run merge.sh script from libsanitizer directory.
> +- Modify Makefile.am files into asan/tsan/lsan/ubsan/sanitizer_common/interception
> +  directories if needed.  In particular, you may need to add new source files
> +  and remove old ones in source files list, add new flags to {C, CXX}FLAGS if
> +  needed and update DEFS with new defined variables.
> +- Apply all needed GCC-specific patches to libsanitizer (note that some of
> +  them might be already included to upstream).
> +- Apply all necessary compiler changes.  Be especially careful here, you must
> +  not break ABI between compiler and library.
> +- Modify configure.ac file if needed (e.g. if you need to add link against new
> +  library for sanitizer lilbs).
> +- Remove unused (deleted by merge) files from all source and include
> +  directories.  Be especially careful with headers, because they aren't listed
> +  in Makefiles explicitly.
> +- Regenerate configure script and all Makefiles by autoreconf.  You should use
> +  exactly the same autotools version as for other GCC directories (current
> +  version is 2.64, https://www.gnu.org/software/automake/faq/autotools-faq.html
> +  for details how to install/use it).
> +- Run regression testing on at least three platforms (e.g. x86-linux-gnu,
> +  x86_64-linux-gnu, aarch64-linux-gnu).
> +- Run {A, UB}San bootstrap on at least three platforms.

	Jakub

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

* Re: [PATCH v2 1/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:56   ` Jakub Jelinek
@ 2015-10-20 14:14     ` Maxim Ostapenko
  0 siblings, 0 replies; 12+ messages in thread
From: Maxim Ostapenko @ 2015-10-20 14:14 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Kostya Serebryany, GCC Patches, Dmitry Vyukov, Marek Polacek,
	Yury Gribov, Slava Garbuzov, Vyacheslav Barinov

Great, thanks! I'm going to commit the whole patch set tomorrow morning 
if no objections.

On 20/10/15 14:52, Jakub Jelinek wrote:
> On Tue, Oct 20, 2015 at 02:18:25PM +0300, Maxim Ostapenko wrote:
>> This is the merge itself. Added DCAN_SANITIZE_UB={0, 1} and nuked
>> DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 (not used now) in corresponding
>> Makefiles.
> Ok.
>
> 	Jakub
>

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

* Re: [PATCH v2 6/6] Libsanitizer merge from upstream r250806 (was r249633).
  2015-10-20 11:45 ` [PATCH v2 6/6] " Maxim Ostapenko
  2015-10-20 12:06   ` Jakub Jelinek
@ 2015-10-21  9:19   ` Yury Gribov
  1 sibling, 0 replies; 12+ messages in thread
From: Yury Gribov @ 2015-10-21  9:19 UTC (permalink / raw)
  To: Maxim Ostapenko, Jakub Jelinek, Kostya Serebryany, GCC Patches
  Cc: Dmitry Vyukov, Marek Polacek, Slava Garbuzov, Vyacheslav Barinov

On 10/20/2015 02:29 PM, Maxim Ostapenko wrote:
> In this patch, I'm trying to add a general instruction how to perform
> the merge. This is just a documentation patch, any suggestions and
> opinions are welcome.

Thanks, this should simplify work for other maintainers in future)

Some general remarks:
1) Perhaps use standard markup format for easier reading (i.e. s/^-/*/)?
2) We should suggest to run libabigail to compare ABI of 
libclang_rt-asan and libasan?
3) Perhaps it makes sense to mention that patchset should be split in 
logical pieces?
4) You probably forgot to mention SONAME update.

+- Modify Makefile.am files into 
asan/tsan/lsan/ubsan/sanitizer_common/interception
+  directories if needed.  In particular, you may need to add new source 
files
+  and remove old ones in source files list, add new flags to {C, 
CXX}FLAGS if
+  needed and update DEFS with new defined variables.

1) Could you mention where to look for updates (CMakeLists.txt, etc.).
2) Shouldn't we rerun automake (to update Makefile.in and stuff)?
3) Also add new target platforms (if any).

+- Apply all necessary compiler changes.  Be especially careful here, 
you must
+  not break ABI between compiler and library.

Perhaps mention that for compiler changes one should check commit 
history of e.g. llvm/test/Instrumentation?

+- Remove unused (deleted by merge) files from all source and include
+  directories.

This isn't clear. Doesn't merge.sh handle this?

+- Regenerate configure script and all Makefiles by autoreconf.  You 
should use
+  exactly the same autotools version as for other GCC directories (current
+  version is 2.64, 
https://www.gnu.org/software/automake/faq/autotools-faq.html
+  for details how to install/use it).

Rather than stating explicit version of autotools, perhaps tell where to 
find the current one (e.g. it's written at start of current 
libsanitizer/{Makefile.in,configure}?

+- Run regression testing on at least three platforms (e.g. x86-linux-gnu,
+  x86_64-linux-gnu, aarch64-linux-gnu).

Perhaps ARM as well? We saw a number of platform-specific bugs there.

Best regards,
Yury Gribov

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

end of thread, other threads:[~2015-10-21  9:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20 11:17 [PATCH v2 0/6] Libsanitizer merge from upstream r250806 (was r249633) Maxim Ostapenko
2015-10-20 11:20 ` [PATCH v2 1/6] " Maxim Ostapenko
2015-10-20 11:56   ` Jakub Jelinek
2015-10-20 14:14     ` Maxim Ostapenko
2015-10-20 11:22 ` [PATCH v2 2/6] " Maxim Ostapenko
2015-10-20 12:02   ` Jakub Jelinek
2015-10-20 11:25 ` [PATCH v2 0/6] " Maxim Ostapenko
2015-10-20 11:28 ` [PATCH v2 4/6] " Maxim Ostapenko
2015-10-20 11:30 ` [PATCH v2 5/6] " Maxim Ostapenko
2015-10-20 11:45 ` [PATCH v2 6/6] " Maxim Ostapenko
2015-10-20 12:06   ` Jakub Jelinek
2015-10-21  9:19   ` Yury Gribov

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).