diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-07-04 17:25:58 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-07-04 17:25:58 +0000 |
commit | 266aae9b3b8dd7886098ccacedc1934d3c4e2061 (patch) | |
tree | 6bb92d9f33321c19aa430a23b59d9bc643ac1e5c /gcc | |
parent | 0671eaf68f6bbc1a977583e592552d5b68c7f576 (diff) | |
download | gcc-266aae9b3b8dd7886098ccacedc1934d3c4e2061.zip gcc-266aae9b3b8dd7886098ccacedc1934d3c4e2061.tar.gz gcc-266aae9b3b8dd7886098ccacedc1934d3c4e2061.tar.bz2 |
bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA.
* bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA.
* bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a
function.
From-SVN: r43760
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/bitmap.c | 4 | ||||
-rw-r--r-- | gcc/bitmap.h | 15 |
3 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8152ba6..2b66dcb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA. + + * bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a + function. + 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk> * doc/include: New directory. diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 3fa0fb6..5f343a0 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -687,9 +687,11 @@ bitmap_union_of_diff (dst, a, b, c) bitmap c; { int changed = 0; - bitmap temp = BITMAP_ALLOCA (); + bitmap temp = BITMAP_XMALLOC (); + bitmap_operation (temp, b, c, BITMAP_AND_COMPL); changed = bitmap_operation (dst, temp, a, BITMAP_IOR); + BITMAP_XFREE (temp); return changed; } diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 95c2a5e..58e14ee 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -119,10 +119,17 @@ extern int bitmap_last_set_bit PARAMS((bitmap)); #define BITMAP_OBSTACK_ALLOC(OBSTACK) \ bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head))) -/* Allocate a bitmap with alloca. */ -#define BITMAP_ALLOCA() \ - bitmap_initialize ((bitmap) alloca (sizeof (bitmap_head))) - +/* Allocate a bitmap with alloca. Note alloca cannot be passed as an + argument to a function, so we set a temporary variable to the value + returned by alloca and pass that variable to bitmap_initialize(). + PTR is then set to the value returned from bitmap_initialize() to + avoid having it appear more than once in case it has side effects. */ +#define BITMAP_ALLOCA(PTR) \ +do { \ + bitmap temp_bitmap_ = (bitmap) alloca (sizeof (bitmap_head)); \ + (PTR) = bitmap_initialize (temp_bitmap_); \ +} while (0) + /* Allocate a bitmap with xmalloc. */ #define BITMAP_XMALLOC() \ bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head))) |