[PATCH] Weird Linker Error

Nicholas Krause xerofoify@gmail.com
Sat Feb 29 07:29:00 GMT 2020


Please forget  this email seems it was a dumb typo.

Nick

On 2/28/20 5:44 PM, Nicholas Krause wrote:
> From: Nicholas Krause <xerofoify@gmail.com>
>
> Greetings,
>
> Sorry if this is a dumb question but I'm not sure if this is a linker
> error due to not linking pthreads or something else going on. I'm assuming
> its something to do with enabling pthreads but what's weird is it
> does not warn the types are not defined but gives me errors like:
>
> /home/xerofoify/GCC/../gcc/gcc/tree.h:3763: multiple definition of `phi_stmt_iterator_mutex'
> cfgexpand.o:/home/xerofoify/GCC/../gcc/gcc/dumpfile.h:215: first defined here
> omp-grid.o:(.bss+0x0): multiple definition of `imm_iteration_mutex'
> cfgexpand.o:/home/xerofoify/GCC/../gcc/gcc/hwint.h:214: first defined here
> omp-grid.o: In function `bool need_finalization_p<hash_map<tree_node*, tree_node*, simple_hashmap_traits<default_hash_traits<tree_node*>, tree_node*> >::hash_entry>()':
>
> I've checked those lines and none of them seem to be dealing with
> SSA iterators. Thanks in advance for the help.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>   gcc/ssa-iterators.h | 28 ++++++++++++++++++++--------
>   1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/gcc/ssa-iterators.h b/gcc/ssa-iterators.h
> index 98724da..65d8e3b 100644
> --- a/gcc/ssa-iterators.h
> +++ b/gcc/ssa-iterators.h
> @@ -16,6 +16,7 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>   You should have received a copy of the GNU General Public License
>   along with GCC; see the file COPYING3.  If not see
>   <http://www.gnu.org/licenses/>.  */
> +#include <pthread.h>
>   
>   #ifndef GCC_SSA_ITERATORS_H
>   #define GCC_SSA_ITERATORS_H
> @@ -68,6 +69,10 @@ struct imm_use_iterator
>     ssa_use_operand_t *next_imm_name;
>   };
>   
> +/*IMM Iterator Mutex*/
> +pthread_mutex_t imm_iteration_mutex;
> +/*IMM_STMT Iterator Mutex*/
> +pthread_mutex_t imm_stmt_iterator_mutex;
>   
>   /* Use this iterator when simply looking at stmts.  Adding, deleting or
>      modifying stmts will cause this iterator to malfunction.  */
> @@ -82,7 +87,7 @@ struct imm_use_iterator
>   #define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR)		\
>     for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR));		\
>          !end_imm_use_stmt_p (&(ITER));				\
> -       (void) ((STMT) = next_imm_use_stmt (&(ITER))))
> +       (void) ((STMT) = next_imm_use_stmt (&(ITER))))           \
>   
>   /* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early.  Failure to
>      do so will result in leaving a iterator marker node in the immediate
> @@ -116,7 +121,7 @@ struct imm_use_iterator
>   #define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER)			\
>     for ((DEST) = first_imm_use_on_stmt (&(ITER));		\
>          !end_imm_use_on_stmt_p (&(ITER));			\
> -       (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
> +       (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))        \
>   
>   
>   
> @@ -147,6 +152,13 @@ struct ssa_op_iter
>     gimple *stmt;
>   };
>   
> +/*SSA Iterator Mutex*/
> +pthread_mutex_t ssa_iteration_mutex;
> +/*PHI Iterator Mutex*/
> +pthread_mutex_t phi_iteration_mutex;
> +/*PHI_STMT Iterator Mutex*/
> +pthread_mutex_t phi_stmt_iterator_mutex;
> +
>   /* NOTE: Keep these in sync with doc/tree-ssa.texi.  */
>   /* These flags are used to determine which operands are returned during
>      execution of the loop.  */
> @@ -168,7 +180,7 @@ struct ssa_op_iter
>   #define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS)	\
>     for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS);	\
>          !op_iter_done (&(ITER));					\
> -       (void) (TREEVAR = op_iter_next_tree (&(ITER))))
> +       (void) (TREEVAR = op_iter_next_tree (&(ITER))))          \
>   
>   /* This macro executes a loop over the operands of STMT specified in FLAG,
>      returning each operand as a 'use_operand_p' in the variable USEVAR.
> @@ -176,7 +188,7 @@ struct ssa_op_iter
>   #define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS)	\
>     for (USEVAR = op_iter_init_use (&(ITER), STMT, FLAGS);	\
>          !op_iter_done (&(ITER));					\
> -       USEVAR = op_iter_next_use (&(ITER)))
> +       USEVAR = op_iter_next_use (&(ITER)))                     \
>   
>   /* This macro executes a loop over the operands of STMT specified in FLAG,
>      returning each operand as a 'def_operand_p' in the variable DEFVAR.
> @@ -184,7 +196,7 @@ struct ssa_op_iter
>   #define FOR_EACH_SSA_DEF_OPERAND(DEFVAR, STMT, ITER, FLAGS)	\
>     for (DEFVAR = op_iter_init_def (&(ITER), STMT, FLAGS);	\
>          !op_iter_done (&(ITER));					\
> -       DEFVAR = op_iter_next_def (&(ITER)))
> +       DEFVAR = op_iter_next_def (&(ITER)))                     \
>   
>   /* This macro will execute a loop over all the arguments of a PHI which
>      match FLAGS.   A use_operand_p is always returned via USEVAR.  FLAGS
> @@ -192,7 +204,7 @@ struct ssa_op_iter
>   #define FOR_EACH_PHI_ARG(USEVAR, STMT, ITER, FLAGS)		\
>     for ((USEVAR) = op_iter_init_phiuse (&(ITER), STMT, FLAGS);	\
>          !op_iter_done (&(ITER));					\
> -       (USEVAR) = op_iter_next_use (&(ITER)))
> +       (USEVAR) = op_iter_next_use (&(ITER)))                   \
>   
>   
>   /* This macro will execute a loop over a stmt, regardless of whether it is
> @@ -204,7 +216,7 @@ struct ssa_op_iter
>   					  FLAGS)		\
>   		   : op_iter_init_use (&(ITER), STMT, FLAGS));	\
>          !op_iter_done (&(ITER));					\
> -       (USEVAR) = op_iter_next_use (&(ITER)))
> +       (USEVAR) = op_iter_next_use (&(ITER)))                   \
>   
>   /* This macro will execute a loop over a stmt, regardless of whether it is
>      a real stmt or a PHI node, looking at the DEF nodes matching FLAGS.  */
> @@ -215,7 +227,7 @@ struct ssa_op_iter
>   					  FLAGS)		\
>   		   : op_iter_init_def (&(ITER), STMT, FLAGS));	\
>          !op_iter_done (&(ITER));					\
> -       (DEFVAR) = op_iter_next_def (&(ITER)))
> +       (DEFVAR) = op_iter_next_def (&(ITER)))                   \
>   
>   /* This macro returns an operand in STMT as a tree if it is the ONLY
>      operand matching FLAGS.  If there are 0 or more than 1 operand matching



More information about the Gcc mailing list