i965/fs: Check for compilation failure and bail before optimizing.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 10 Jun 2011 23:00:03 +0000 (16:00 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 19 Jun 2011 00:53:24 +0000 (17:53 -0700)
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 8580c78fea1ac18ffcc86f0915bdb583fca49ebf..1cd673919f849a6a09e9d4b6de575187dbd6e451 100644 (file)
@@ -1533,6 +1533,8 @@ fs_visitor::run()
         this->result = reg_undef;
         ir->accept(this);
       }
+      if (failed)
+        return false;
 
       emit_fb_writes();