forked from iains/gcc-14-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl.
config/ * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl. gcc/c-family/ * c-ubsan.c (ubsan_instrument_division): Adjust ubsan_create_data call. (ubsan_instrument_shift): Likewise. (ubsan_instrument_vla): Likewise. gcc/ * opts.c (common_handle_option): Add -fsanitize=null option. Turn off -fdelete-null-pointer-checks option when doing the NULL pointer checking. * sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH): Add. * tree-pass.h (make_pass_ubsan): Declare. (make_pass_sanopt): Declare. * timevar.def (TV_TREE_UBSAN): New timevar. * passes.def: Add pass_sanopt and pass_ubsan. * ubsan.h (ubsan_null_ckind): New enum. (ubsan_mismatch_data): New struct. (ubsan_expand_null_ifn): Declare. (ubsan_create_data): Adjust declaration. (ubsan_type_descriptor): Likewise. * asan.c: Include "ubsan.h". (pass_data_sanopt): New pass. (execute_sanopt): New function. (gate_sanopt): Likewise. (make_pass_sanopt): Likewise. (class pass_sanopt): New class. * ubsan.c: Include tree-pass.h, gimple-ssa.h, gimple-walk.h, gimple-iterator.h and cfgloop.h. (PROB_VERY_UNLIKELY): Define. (tree_type_map_hash): New function. (ubsan_type_descriptor): Add new parameter. Improve type name generation. (ubsan_create_data): Add new parameter. Add pointer data into ubsan structure. (ubsan_expand_null_ifn): New function. (instrument_member_call): Likewise. (instrument_mem_ref): Likewise. (instrument_null): Likewise. (ubsan_pass): Likewise. (gate_ubsan): Likewise. (make_pass_ubsan): Likewise. (ubsan_instrument_unreachable): Adjust ubsan_create_data call. (class pass_ubsan): New class. (pass_data_ubsan): New pass. * flag-types.h (enum sanitize_code): Add SANITIZE_NULL. * internal-fn.c (expand_UBSAN_NULL): New function. * cgraphunit.c (varpool_finalize_decl): Call varpool_assemble_decl even when !flag_toplevel_reorder. * internal-fn.def (UBSAN_NULL): New. gcc/testsuite/ * c-c++-common/ubsan/null-1.c: New test. * c-c++-common/ubsan/null-2.c: New test. * c-c++-common/ubsan/null-3.c: New test. * c-c++-common/ubsan/null-4.c: New test. * c-c++-common/ubsan/null-5.c: New test. * c-c++-common/ubsan/null-6.c: New test. * c-c++-common/ubsan/null-7.c: New test. * c-c++-common/ubsan/null-8.c: New test. * c-c++-common/ubsan/null-9.c: New test. * c-c++-common/ubsan/null-10.c: New test. * c-c++-common/ubsan/null-11.c: New test. * gcc.dg/ubsan/c99-shift-2.c: Adjust dg-output. * c-c++-common/ubsan/shift-1.c: Likewise. * c-c++-common/ubsan/div-by-zero-3.c: Likewise. From-SVN: r205021
- Loading branch information
Showing
32 changed files
with
707 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
2013-11-19 Marek Polacek <[email protected]> | ||
|
||
* bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl. | ||
|
||
2013-11-15 Andreas Schwab <[email protected]> | ||
|
||
* picflag.m4 (m68k-*-*): Use default PIC flag. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,48 @@ | ||
2013-11-19 Marek Polacek <[email protected]> | ||
|
||
* opts.c (common_handle_option): Add -fsanitize=null option. | ||
Turn off -fdelete-null-pointer-checks option when doing the | ||
NULL pointer checking. | ||
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH): Add. | ||
* tree-pass.h (make_pass_ubsan): Declare. | ||
(make_pass_sanopt): Declare. | ||
* timevar.def (TV_TREE_UBSAN): New timevar. | ||
* passes.def: Add pass_sanopt and pass_ubsan. | ||
* ubsan.h (ubsan_null_ckind): New enum. | ||
(ubsan_mismatch_data): New struct. | ||
(ubsan_expand_null_ifn): Declare. | ||
(ubsan_create_data): Adjust declaration. | ||
(ubsan_type_descriptor): Likewise. | ||
* asan.c: Include "ubsan.h". | ||
(pass_data_sanopt): New pass. | ||
(execute_sanopt): New function. | ||
(gate_sanopt): Likewise. | ||
(make_pass_sanopt): Likewise. | ||
(class pass_sanopt): New class. | ||
* ubsan.c: Include tree-pass.h, gimple-ssa.h, gimple-walk.h, | ||
gimple-iterator.h and cfgloop.h. | ||
(PROB_VERY_UNLIKELY): Define. | ||
(tree_type_map_hash): New function. | ||
(ubsan_type_descriptor): Add new parameter. | ||
Improve type name generation. | ||
(ubsan_create_data): Add new parameter. Add pointer data into | ||
ubsan structure. | ||
(ubsan_expand_null_ifn): New function. | ||
(instrument_member_call): Likewise. | ||
(instrument_mem_ref): Likewise. | ||
(instrument_null): Likewise. | ||
(ubsan_pass): Likewise. | ||
(gate_ubsan): Likewise. | ||
(make_pass_ubsan): Likewise. | ||
(ubsan_instrument_unreachable): Adjust ubsan_create_data call. | ||
(class pass_ubsan): New class. | ||
(pass_data_ubsan): New pass. | ||
* flag-types.h (enum sanitize_code): Add SANITIZE_NULL. | ||
* internal-fn.c (expand_UBSAN_NULL): New function. | ||
* cgraphunit.c (varpool_finalize_decl): Call varpool_assemble_decl | ||
even when !flag_toplevel_reorder. | ||
* internal-fn.def (UBSAN_NULL): New. | ||
|
||
2013-11-19 Jan Hubicka <[email protected]> | ||
|
||
* cgraph.c (cgraph_create_indirect_edge): Use get_polymorphic_call_info. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
2013-11-19 Marek Polacek <[email protected]> | ||
|
||
* c-ubsan.c (ubsan_instrument_division): Adjust ubsan_create_data | ||
call. | ||
(ubsan_instrument_shift): Likewise. | ||
(ubsan_instrument_vla): Likewise. | ||
|
||
2013-11-18 Richard Sandiford <[email protected]> | ||
|
||
* c-common.c (convert_vector_to_pointer_for_subscript): Remove | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
2013-11-19 Marek Polacek <[email protected]> | ||
|
||
* c-c++-common/ubsan/null-1.c: New test. | ||
* c-c++-common/ubsan/null-2.c: New test. | ||
* c-c++-common/ubsan/null-3.c: New test. | ||
* c-c++-common/ubsan/null-4.c: New test. | ||
* c-c++-common/ubsan/null-5.c: New test. | ||
* c-c++-common/ubsan/null-6.c: New test. | ||
* c-c++-common/ubsan/null-7.c: New test. | ||
* c-c++-common/ubsan/null-8.c: New test. | ||
* c-c++-common/ubsan/null-9.c: New test. | ||
* c-c++-common/ubsan/null-10.c: New test. | ||
* c-c++-common/ubsan/null-11.c: New test. | ||
* gcc.dg/ubsan/c99-shift-2.c: Adjust dg-output. | ||
* c-c++-common/ubsan/shift-1.c: Likewise. | ||
* c-c++-common/ubsan/div-by-zero-3.c: Likewise. | ||
|
||
2013-11-19 Uros Bizjak <[email protected]> | ||
|
||
* gcc.dg/c11-complex-1.c: Use dg-add-options ieee. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-do run } */ | ||
/* { dg-options "-fsanitize=null -w" } */ | ||
/* { dg-shouldfail "ubsan" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ | ||
|
||
int | ||
main (void) | ||
{ | ||
int *p = 0; | ||
return *p; | ||
} | ||
|
||
/* { dg-output "load of null pointer of type 'int'(\n|\r\n|\r)" } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* { dg-do run } */ | ||
/* { dg-options "-fsanitize=null -w" } */ | ||
/* { dg-shouldfail "ubsan" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ | ||
|
||
int | ||
main (void) | ||
{ | ||
short *p = 0, *u; | ||
*(u + *p) = 23; | ||
return 0; | ||
} | ||
|
||
/* { dg-output "load of null pointer of type 'short int'(\n|\r\n|\r)" } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* { dg-do run } */ | ||
/* { dg-options "-fsanitize=null -w" } */ | ||
/* { dg-shouldfail "ubsan" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ | ||
|
||
struct S { | ||
int i; | ||
}; | ||
|
||
int | ||
main (void) | ||
{ | ||
struct S **s = 0; | ||
return (*s)->i; | ||
} | ||
|
||
/* { dg-output "load of null pointer of type 'struct S \\*'(\n|\r\n|\r)" } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* { dg-do run } */ | ||
/* { dg-options "-fsanitize=null -w" } */ | ||
/* { dg-shouldfail "ubsan" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ | ||
|
||
int | ||
main (void) | ||
{ | ||
int ***ppp = 0; | ||
return ***ppp; | ||
} | ||
|
||
/* { dg-output "load of null pointer of type 'int \\*\\*'(\n|\r\n|\r)" } */ |
Oops, something went wrong.