target-supports.exp (check_effective_target_keeps_null_pointer_checks): New function.

* lib/target-supports.exp(check_effective_target_keeps_null_pointer_checks): New function.
* gcc.dg/tree-ssa/20030730-1.c: Use keeps_null_pointer_checks to determine correct test response.
* gcc.dg/tree-ssa/20030730-2.c: Ditto.
* gcc.dg/tree-ssa/pr20701.c: Ditto.
* gcc.dg/tree-ssa/pr20702.c: Ditto.
* gcc.dg/tree-ssa/pr21086.c: Ditto.
* gcc.dg/tree-ssa/vrp02.c:: Ditto.
* gcc.dg/tree-ssa/vrp07.c:: Ditto.
* gcc.dg/tree-ssa/vrp08.c:: Ditto.

From-SVN: r136970
This commit is contained in:
Andy Hutchinson 2008-06-19 22:08:25 +00:00 committed by Andy Hutchinson
parent 15f0f116ce
commit ad0dc07d8a
10 changed files with 59 additions and 17 deletions

View File

@ -1,3 +1,17 @@
2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com>
* lib/target-supports.exp
(check_effective_target_keeps_null_pointer_checks) : New function.
* gcc.dg/tree-ssa/20030730-1.c: Use keeps_null_pointer_checks to
determine correct test response.
* gcc.dg/tree-ssa/20030730-2.c: Ditto.
* gcc.dg/tree-ssa/pr20701.c: Ditto.
* gcc.dg/tree-ssa/pr20702.c: Ditto.
* gcc.dg/tree-ssa/pr21086.c: Ditto.
* gcc.dg/tree-ssa/vrp02.c:: Ditto.
* gcc.dg/tree-ssa/vrp07.c:: Ditto.
* gcc.dg/tree-ssa/vrp08.c:: Ditto.
2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com>
* gcc.dg/pragma-pack-4.c: Skip for AVR target.

View File

@ -18,7 +18,8 @@ foo (int attr_kind, unsigned long offset)
exit (0);
}
/* There should be no IF conditionals. */
/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "dom3" } } */

View File

@ -18,7 +18,8 @@ foo (int attr_kind, unsigned long offset)
exit (0);
}
/* There should be no IF conditionals. */
/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "dom3" } } */

View File

@ -35,5 +35,7 @@ can_combine_p (rtx insn, rtx elt)
return 0;
}
/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp2" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp2" } } */

View File

@ -25,5 +25,7 @@ foo (int *p, int b)
return a;
}
/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */

View File

@ -15,6 +15,9 @@ foo (int *p)
return 0;
}
/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" } } */
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate " 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" { target { ! avr-*-* } } } } */
/* { dg-final { scan-tree-dump "b_. =" "vrp1" { target { avr-*-* } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */

View File

@ -19,6 +19,7 @@ foo (struct A *p, struct A *q)
if (p)
return x + p->b;
}
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* Target with fno-delete-null-pointer-checks should not fold check */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */

View File

@ -29,8 +29,11 @@ foo (int i, int *p)
return i;
}
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */

View File

@ -17,7 +17,8 @@ foo (int a, int *p)
return a;
}
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" } } */
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */

View File

@ -398,6 +398,20 @@ proc check_effective_target_trampolines { } {
return 1
}
# Return 1 if according to target_info struct and explicit target list
# target is supposed to keep null pointer checks. This could be due to
# use of option fno-delete-null-pointer-checks or hardwired in target.
proc check_effective_target_keeps_null_pointer_checks { } {
if [target_info exists keeps_null_pointer_checks] {
return 1
}
if { [istarget avr-*-*] } {
return 1;
}
return 0
}
# Return true if profiling is supported on the target.
proc check_profiling_available { test_what } {