[2.6 patch] ath9k: work around gcc ICEs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Adrian Bunk
Date: Tuesday, August 5, 2008 - 12:06 pm

On Tue, Aug 05, 2008 at 12:00:26PM -0400, John W. Linville wrote:

Patch below, verified to fix the issue with the following compilers:
- powerpc 4.2.4
- powerpc latest 4.3 SVN
- powerpc latest 4.4 SVN
- mips 4.2.4
- mips 4.3.1

The patch has to be applied twice for fixing both copies of the
same code.  :-)


cu
Adrian


<--  snip  -->


This patch works around an internal compiler error (gcc bug #37014) in 
all gcc 4.2 compilers and the gcc 4.3 series up to at least 4.3.1
on at least powerpc and mips.

Many thanks to Andrew Pinski for analyzing the gcc bug.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
d1ec5b9fba6c50c7e98a85776a3b95d3a3a3179b 
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 1f6f393..5edc56d 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -4801,7 +4801,11 @@
 
 	for (i = 0; i < 123; i++) {
 		if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) {
-			if ((abs(cur_vit_mask - bin)) < 75)
+
+			/* workaround for gcc bug #37014 */
+			volatile int tmp = abs(cur_vit_mask - bin);
+
+			if (tmp < 75)
 				mask_amt = 1;
 			else
 				mask_amt = 0;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
linux-next: wireless-current tree build failure, Stephen Rothwell, (Mon Aug 4, 11:21 pm)
Re: linux-next: wireless-current tree build failure, Adrian Bunk, (Tue Aug 5, 8:37 am)
Re: linux-next: wireless-current tree build failure, John W. Linville, (Tue Aug 5, 9:00 am)
Re: linux-next: wireless-current tree build failure, Stephen Rothwell, (Tue Aug 5, 9:02 am)
Re: linux-next: wireless-current tree build failure, Stephen Rothwell, (Tue Aug 5, 9:35 am)
[2.6 patch] ath9k: work around gcc ICEs, Adrian Bunk, (Tue Aug 5, 12:06 pm)