Re: [llvm-commits] Persistent regression failures

2007-04-29 Thread me22
On 29/04/07, Chris Lattner [EMAIL PROTECTED] wrote:
 On Apr 29, 2007, at 8:09 AM, Jeff Cohen wrote:
  Two tests that broke yesterday are still broke:
 
  CFrontend/2007-04-11-InlineAsmStruct.c
  CFrontend/2007-04-11-InlineAsmUnion.c
 
 These both pass for me.  Three options: your CFE isn't up-to-date,
 the test is broken for your target, or the compiler is broken for
 your target.

I see them broken as well:

Running /home/me22/programming/llvm-cvs/test/CFrontend/dg.exp ...
FAIL: 
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmStruct.c
Failed with exit(1) at line 1
while running: /usr/local/bin/llvm-gcc -emit-llvm
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmStruct.c
-S -emit-llvm -o - | grep {call i32 asm}
child process exited abnormally
FAIL: /home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmUnion.c
Failed with exit(1) at line 1
while running: /usr/local/bin/llvm-gcc -emit-llvm
/home/me22/programming/llvm-cvs/test/CFrontend/2007-04-11-InlineAsmUnion.c
-S -emit-llvm -o - | grep {call i32 asm}
child process exited abnormally

~ Scott
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] Patch for strict alias warning in Support/Allocator.cpp

2007-02-21 Thread me22

I only saw 3 warnings compiling llvm, 2 of which looked like flex's
fault, so it made me want to fix the other one:
Allocator.cpp: In member function 'void*
llvm::BumpPtrAllocator::Allocate(unsigned int, unsigned int)':
Allocator.cpp:96: warning: dereferencing type-punned pointer will
break strict-aliasing rules

I'm not convinced it actually broke aliasing rules, but it's a fairly
trivial fix that simplifies the code, so it seems worth it.  Only
possible drawback is that it (opaquely) exposes MemRegion, but that
identifier is used nowhere else in llvm at the moment.

HTH,
Scott McMurray
Index: include/llvm/Support/Allocator.h
===
RCS file: /var/cvs/llvm/llvm/include/llvm/Support/Allocator.h,v
retrieving revision 1.1
diff -t -d -u -p -5 -r1.1 Allocator.h
--- include/llvm/Support/Allocator.h	29 Oct 2006 22:08:03 -	1.1
+++ include/llvm/Support/Allocator.h	22 Feb 2007 06:15:06 -
@@ -26,16 +26,18 @@ public:
   void *Allocate(unsigned Size, unsigned Alignment) { return malloc(Size); }
   void Deallocate(void *Ptr) { free(Ptr); }
   void PrintStats() const {}
 };
 
+class MemRegion;
+
 /// BumpPtrAllocator - This allocator is useful for containers that need very
 /// simple memory allocation strategies.  In particular, this just keeps
 /// allocating memory, and never deletes it until the entire block is dead. This
 /// makes allocation speedy, but must only be used when the trade-off is ok.
 class BumpPtrAllocator {
-  void *TheMemory;
+  MemRegion *TheMemory;
 public:
   BumpPtrAllocator();
   ~BumpPtrAllocator();
   
   void *Allocate(unsigned Size, unsigned Alignment);
Index: lib/Support/Allocator.cpp
===
RCS file: /var/cvs/llvm/llvm/lib/Support/Allocator.cpp,v
retrieving revision 1.5
diff -t -d -u -p -5 -r1.5 Allocator.cpp
--- lib/Support/Allocator.cpp	7 Dec 2006 23:41:45 -	1.5
+++ lib/Support/Allocator.cpp	22 Feb 2007 06:15:06 -
@@ -19,11 +19,11 @@ using namespace llvm;
 
 //===--===//
 // MemRegion class implementation
 //===--===//
 
-namespace {
+namespace llvm {
 /// MemRegion - This is one chunk of the BumpPtrAllocator.
 class MemRegion {
   unsigned RegionSize;
   MemRegion *Next;
   char *NextPtr;
@@ -82,26 +82,26 @@ public:
 //===--===//
 // BumpPtrAllocator class implementation
 //===--===//
 
 BumpPtrAllocator::BumpPtrAllocator() {
-  TheMemory = malloc(4096);
-  ((MemRegion*)TheMemory)-Init(4096, 1, 0);
+  TheMemory = (MemRegion*)malloc(4096);
+  TheMemory-Init(4096, 1, 0);
 }
 
 BumpPtrAllocator::~BumpPtrAllocator() {
-  ((MemRegion*)TheMemory)-Deallocate();
+  TheMemory-Deallocate();
 }
 
 void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) {
-  return ((MemRegion*)TheMemory)-Allocate(Size, Align,(MemRegion**)TheMemory);
+  return TheMemory-Allocate(Size, Align,TheMemory);
 }
 
 void BumpPtrAllocator::PrintStats() const {
   unsigned BytesUsed = 0;
   unsigned NumRegions = 0;
-  const MemRegion *R = (MemRegion*)TheMemory;
+  const MemRegion *R = TheMemory;
   for (; R; R = R-getNext(), ++NumRegions)
 BytesUsed += R-getNumBytesAllocated();
 
   cerr  \nNumber of memory regions:   NumRegions  \n;
   cerr  Bytes allocated:   BytesUsed  \n;
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits